Getting started with Git Log

The easy option:

git log --graph --decorate --oneline

  • --graph draws a graph indicating commits (implies --topo-order)
  • --decorate shows any ref names (tags and branches)
  • --oneline shows the start of the commit sha and the commit title

The more complicated option:

git log --graph --pretty=format:'%C(cyan)%an (%cr) %C(yellow)%h%Cred%d%Creset %s'

It's much like the easy option, but with author and time-since-commit

You might also want to mix these in sometimes:

  • --all shows all commits (across other branches)
  • --author-date-order orders by date of commit, which mixes in commits from different branches
  • --patch shows changes between commits as a patch
adre