j2r2b

My notes on GitHub pages

Follow me on GitHub

Alias for git: lg (log graph with colors)

I like to use graphical git clients, but sometimes it is usefull to see the git graph directly in the console.

git lg in the terminal

To do this, you can add this to your ~/.gitconfig file:

[alias]
       lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

Usage:

git lg

or:

git lg --all