Git Aliases Are Awesome

less than 1 minute read

TIL about git aliases, and how they can speed up your git workflow.

I’ve been using git a ton over the past year, both for work and for side projects. I’ve gotten quite speedy at typing out the git standards (e.g. git status, git checkout, git commit -a -m) but they still take a second to write and could be alias’ed.

Enter git aliases, which can be added to the .git/config file in your repo under an [alias] section header. They allow you to create your own git specific aliases for each git repository you create. It is better to put them here instead of in your .bashrc both for organizational purposes (keep git with git) but also to speed up the source-ing of your .bashrc AND to take advantage of git’s default bash auto-completion. All aliases are of the form git <alias>.

I stole most of my aliases from the following blog post which had a lot of really useful ones. A nice command added to the alias list is git la, which lists all of the commands in case you need a reference while changing your workflow.