DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 964,423 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Alan Johnson
Alan Johnson

Posted on

A Couple of GitHub CLI Aliases

One thing I love about GitHub CLI is that it's easy to define aliases. You can run gh alias set ... to define a new alias and add all sorts of useful commands. Here are two that I use every day:

gh alias set w 'run watch'
Enter fullscreen mode Exit fullscreen mode

I type gh run watch constantly, so shortening it to gh w is very handy.

gh alias set merge 'pr merge -d'
Enter fullscreen mode Exit fullscreen mode

This one makes it where typing gh merge will merge the pr for the current branch, delete the branch on the remote and locally, and switch you back to your main branch.


It's always handy to save a few keystrokes. Define some aliases of your own and share them here in the comments!

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.