Some handy Git aliases
17 Aug 2017 | gitI got some useful Git aliases a while ago and was starting with a new client where I needed to recreate them so I decided the document them here.
git s
is useful for short status display, defined like this:
git config --global alias.s 'status --short'
git lg
is a short, graphical log display, defined like this:
git config --global alias.lg 'log --oneline --decorate --graph'
Example output is:
Then I decided to augment it with useful extra information, including colouring.
git config --global alias.lg 'log --graph --format="%C(auto)%h %C(cyan)%cn%C(auto)%d %s %C(magenta)%cr"'
The %C(auto)
specification does not colour committer name or date, so I coloured those
explicitly.
Documentation is here: