Inspecting a Git Repository

useful log commands

Logging the last five commits:

git log -5
git log -n 5
git log -n 5 --oneline

Show stat, diff, or both:

git log --stat
git log --patch
git log --patch-with-stat

List all branches containing a given commit:

useful branch commands

ref1

git branch --contains <commit>

# also include remotes
git branch --remotes --contains <commit>

find commits containing a given pattern

In the current branch:

git log -S 'pattern'

In all commits and all branches:

git grep pattern $(git rev-list --all)