Enhance Git Log

The output of git log command is the most frustrating thing you face on git shell usage. But in one minute a poor git log output like

is enhanced to

It is done in the following way:

git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%aN, %cr)%Creset' --abbrev-commit --date=relative"

Git aliases are defined in ~/.gitconfig file. There are my favorite git aliases:

[email protected]:~$ cat ~/.gitconfig
[user]
name = mykhaylo
email = [email protected]
[color]
diff = auto
status = auto
branch = auto
[alias]
st = status
co = checkout
ci = commit
cs = commit -s
br = branch -a
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%aN, %cr)%Creset' --abbrev-commit --date=relative

Share