The Ultimate Git Log Format

I was recently working my way through Git Immersion, a great guided tour of git. We use git almost exclusively at work and I’m always looking for tricks to improve my git workflow. One of the first ones I found was the Ultimate Log Format which is a custom log format output that lets you quickly see the latest commits.

git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short

Custom git log

For comparison, here is the standard git log:

Normal git log

As the guide says, typing/memorizing that command will be a little difficult, so put it in your .gitconfig as an alias to make your life easier.

[alias]
    hist = log --pretty=format:\"%h | %ad | %s%Cred%d%Creset %Cgreen[%an]%Creset\" --graph --date=short