This command allows you to see your commit history in a much more aesthetically appealing format:
git log --pretty=format:'%Cred%h %C(bold green)(%ad)%Creset %<|(78,trunc)%s %C(bold blue)<%an>%C(bold yellow)%d%Creset%n%n%-b' --date=format:'%b %d, %I:%M%P' --graph
Run this command in your terminal to make git lg
an alias for the above:
git config --global alias.lg "log --pretty=format:'%Cred%h %C(bold green)(%ad)%Creset %<|(78,trunc)%s %C(bold blue)<%an>%C(bold yellow)%d%Creset%n%n%-b' --date=format:'%b %d, %I:%M%P' --graph"
Inspired by this post by Filipe Kiss.
Note: if it doesn't work, try replacing the date portion with
--date=relative
,--date=short
, or one of the other options from the git log man page. It seems that the original configuration only works on more recent versions of git.