Git: History & search
7 Git commands: History & search. Click a command to see what each part does.
Git: History & searchIndex
History & search7
git log --oneline --graph --decorate --allCompact graph of all branchesWhat each part does
git logshow commit history--onelineone line per commit: short hash + subject--graphASCII graph of branches and merges--decorateshow branch and tag names next to commits--allinclude every branch and tag, not just the current one
git log --oneline | grep -i <text>Find commits whose message mentions somethingWhat each part does
git log --onelineone commit per line| grep -i <text>keep lines containing <text>, any case
Tip Built-in: git log --oneline --grep=<text> -i
git log --oneline --author=<name> --since=<date> --until=<date>Commits by someone in a date rangeWhat each part does
--author=<name>author matches (regex)--since / --untildate range, e.g. "2 weeks ago", 2026-11-01
git log -S"<text>" -pWhen was this string added or removed?What each part does
-S"<text>""pickaxe": commits that changed how many times <text> appears-pshow the diff of each matching commit
git log --follow -p -- <file>History of one file, across renamesWhat each part does
--followkeep following the file when it was renamed-pwith diffs-- <file>"--" ends options; what follows is a path
git blame -L <start>,<end> -- <file>Who changed these linesWhat each part does
blamelast commit + author for every line-L <start>,<end>only that line range
git status -sb; git diff; git diff --stagedWhat is staged vs notWhat each part does
status -sbshort status with branch infogit diffunstaged changesgit diff --stagedwhat will go into the next commit
Nothing matches.
My DevOps Playbook by Angelo John Calleja