Code
git
# Compact one-line history
git log --oneline
git log --oneline -10 # last 10 commits
# Show changes (patch) for each commit
git log -p -2
# Show file stats per commit
git log --stat
# Search commit messages
git log --grep="fix"
git log --author="Alice"
# Show commits that touched a file
git log -- file.txt
git log --follow -- file.txt # follow renames
# Visual graph of branches
git log --oneline --graph --all --decorate
# Commits between dates
git log --since="2 weeks ago" --until="yesterday"
# Format output
git log --pretty=format:"%h %an %ar %s"