Git Aliases

A collection of essential git aliases I use on a daily basis.

Simply run the git config ... command once to globally register the aliases.

# git ph - push HEAD to origin
$ git config --global alias.ph 'push origin HEAD'

# git c "{message}" - shorthand for commit -m
$ git config --global alias.c 'commit -m'

# git unstage {files} - unstage files matching the pattern
$ git config --global alias.unstage "reset HEAD --"

# git stage {files} - stage files matching the pattern
$ git config --global alias.stage "add"

# git revert-unpushed
$ git config --global alias.revert-unpushed "reset --soft HEAD~1"