git log
A cheatsheet by @rstacruz|Refreshed 7 months ago.Refresh|View source on Github

Revision ranges

Revision ranges

git log master             # branch
git log origin/master      # branch, remote
git log v1.0.0             # tag

git log master develop

git log v2.0..master       # reachable from *master* but not *v2.0*
git log v2.0...master      # reachable from *master* and *v2.0*, but not both

See gitrevisions.

Basic filters

Basic filters

-n, --max-count=2
    --skip=2
    --since="1 week ago"
    --until="yesterday"
    --author="Rico"
    --committer="Rico"

Limiting

Limiting

    --merges
    --no-merges
    --first-parent          # no stuff from merged branches
    --branches="feature/*"
    --tags="v*"
    --remotes="origin"

Simplification

Simplification

git log -- app/file.rb          # only file
    --simplify-by-decoration    # tags and branches

Ordering

Ordering

    --date-order
    --author-date-order
    --topo-order              # "smart" ordering
    --reverse

Formatting

Formatting

    --abbrev-commit
    --oneline
    --graph