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, to create the st
alias, I entered:
git config --global alias.st status
Of course, you don't have to use global
. Your alternatives are system
and local
, but personally, I always use global
because I'm the only one on this computer and I want it to always be available.
Here is a slightly more complicated alias that allows you to create a branch and...