How to Utilize Git Aliases

Recently I had the opportunity to volunteer my time as a React developer for a non-profit start up. Upon working with the tech lead, I quickly realized that I could learn a lot from this person, from in depth technical knowledge, to simple shortcuts that would make my life as a developer easier. Git Aliases are certainly one of those shortcuts that every one should know to make their production go just that much smoother

What Is and Alias?

In Git, an Alias is exactly what it sounds like. It is a nickname or alias you create for common git commands. Put simply, it is the difference between typing out an entire Git command, and entering a shortcut you created to execute the same process. This can be easily understood if we take a look at some examples.

Creating My Own Git Alias

If you are familiar with Git, you are most likely familiar with the common command git status. This command is short, only two words, but imagine having to type it out over thirty times in the span of a day. This takes up a lot of time doing something repetitive, going against a programmers natural D.R.Y. (don’t repeat yourself!) instincts.

Some More Uses

Of course I am sure you are already thinking of your own uses for aliases. You can set aliases for checkouts, branches, commits, or anything else you can imagine with Git that you may be doing multiple times in one programming sitting.

This sets up an alias to log the most recent commit

Try It Out!

These are just two simple examples, but the possibilities with Aliases are extensive. They can make your programming experience quicker, more efficient, and easier. I recommend trying out these commands, and then trying to create some of your own Aliases for git commands you use often.

I ‘m a Web Developer and a Flatiron coding bootcamp alumni. I currently work in the financial tech industry as a Front End Engineer