8

Aliases

Stop working so hard! In this chapter, we will look at Git aliases, which greatly reduce the amount of typing you have to do. Aliases can be very simple, or they can take arguments and flags.

Aliases

Aliases they allow you to create shortcuts to git commands. For example, I have the alias st, which stands for status. Thus, I enter:

git st

and it is exactly as if I had entered:

git status

We'll get to more exciting and useful aliases in just a moment, but first let's look at how these are created. To create an alias:

  • Enter git
  • Enter the keyword config
  • Enter the flag --global
  • Enter the keyword alias followed by a period and then the alias itself
  • Enter the command you are aliasing

This sounds more complicated than it is. For example, ...

Get Git for Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.