Best training I've ever been to!
Although for many people the existence of aliases is an obvious topic, still not many people use them. Besides, I used to assume that having reverse search, I don’t need them, which today I consider a mistake and rarely use Git commands in their original form.
Aliases are a great way to simplify typing commands, and sometimes to sneak various complex operations into a single command. Never again will you have to keep commands and arguments in separate notes - a set of aliases will be your note at the same time.
Aliases can be added at the shell level, but it’s easier to use the mechanism provided by Git, so we’ll focus on that here. To add an alias, just add the [alias]
section in the .gitconfig file and type aliases in new lines with the syntax alias = command [optional-parameter]
(omit the git word).
Example: cnf = config --global -e
Usage: git cnf
Aliases can combine several commands and even take arguments, but to start with, focus on simplifying your basic commands into a short form that you can easily remember e.g. git st
, git co
, git reb
.
Tip: Don’t look for the .gitconfig file on disk, just type git config --global -e
in your shell
Tip2: You can view Tom’s aliases in a public gist on GitHub (user: tometchy)
Download, print and work faster
Boost your productivity right away! Visit free materials section for more.
What our attendees say
87% of attendees gave us the highest ratings!
Get In Touch
Do you have any questions? We have the answers!