Git Alias Workflow

Continuing this article series about Streamlining Workflow, must include a way to streamline our git commands. This article uses my own aliases and a GIST for the full list.

TLTR: Want to just straight to the code? The complete alias file I use is available in this GIST.

Alias possibilities

There are a few ways to add aliases to your system and the natural place to start is by adding them to your terminal configuration. In my case, I have a ton of aliases I have added to my .zshrc workflow.

However, since these are Git commands I have decided to add them to my .gitconfig file. This makes sure my zshrc more DRY. To do this add a new section to your .config titled [alias]. Now, let's begin.

My configuration

I am not going to go over every aliased command in my configuration, just the ones I use most frequently.

Branches

I have several commands that help with branches.Each command is prefixed with git.

Commits

So, to check the status: git st, which uses the -sb switch to trim the CLI to a cleaner output:

## master...origin/master
 M content/posts/git-alias-workflow.md

Remote

This alias is for a combined push with the remote repository:

Your remote:

Working with an upstream

logs

I have a few aliases for git log

Pretty format, with decorate is git ls:

Pretty format, with decorate and --numstat is git ll:

These are my basic aliases that I use the most. Again, refer to the GIST for a complete list.

Footnote

This has been fun. Leave a comment or send me a DM on Twitter.

Shameless Plug: If you work at a great company and you are in the market for a Software Developer with a varied skill set and life experiences, send me a message on Twitter and check out my LinkedIn.