Skip to content

Instantly share code, notes, and snippets.

@RickCardoso
Created June 26, 2025 10:55
Show Gist options
  • Save RickCardoso/c791a1332e89e0f8ceb51affa134f44c to your computer and use it in GitHub Desktop.
Save RickCardoso/c791a1332e89e0f8ceb51affa134f44c to your computer and use it in GitHub Desktop.
GitHub CLI aliases
gh alias set nb --shell 'git checkout -b $1'
# gh nb chore/branch-name -> creates a local branch named chore/branch-name
gh alias set fix --shell 'gh nb fix/$1'
# gh fix component-tests -> creates a local branch named fix/component-tests
gh alias set feat --shell 'gh nb feature/$1'
# gh feat new-component -> creates a local branch named feature/new-component
gh alias set pu --shell 'git push --set-upstream origin $(git branch --show-current)'
# gh pu -> pushes the local branch to remote with the current branch name
gh alias set p --shell 'git push'
# gh p -> pushes the local branch to a defined origin branch
gh alias set mh --shell 'git checkout $1 && git pull && git checkout - && git merge $1'
# gh mh main -> checks out main, pulls from origin, go back to previous branch and merge main to it
gh alias set ic --shell 'git commit -m "$1" --allow-empty'
# gh ic 'feat: ✨ create new button' -> adds an empty commit with the pretty message "feat: ✨ create new button"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment