DEV Community

Alan Johnson
Alan Johnson

Posted on • Edited on • Originally published at nalanj.dev

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)