How to Utilize Git Aliases

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.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aidan McBride

Aidan McBride

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