GIT Aliases

As a long time user of Linux I really like using aliases, it speeds up typing and repetitive commands. Git has also aliases built in so you can use it on all platforms. The only drawback with alias is that when you pair with a colleague or using another box, you cant use them without transfering them.

But they will make you life easier and here are some of my favorites.

Easier to read logs:

This will prints all the commits in just one row with the date, sha short key, comment, and the commiters name.
git config –global alias.l “log –pretty=format:’%cd  %H  %s (%cn)‘ –date=short”

Print a graph of the log and branches

git config –global alias.graph “log –oneline –graph –decorate –all”

Show a shorter version of status

git config –global alias.stat “status -sb”

diff with just the names only

git config –global alias.d “diff –name-only”

Show the log in reverse (start of the branch)

git config –global alias.log-rev “log –oneline –reverse”