Find Changes With git log -S (Pickaxe)
Locate commits that introduced or removed a code string.
Run git log -S "text" to list commits whose diff changed the occurrence count of that text.
01Command
Command
$ git log -S "retry" --oneline -- src/02What it does
Pickaxe search answers 'when did this function or config appear?', which is invaluable when debugging regressions or understanding history. Limiting with a path and -G for regex searches makes it precise and fast on large repositories.
03Risk
!Warning: Pickaxe scans diffs, so very large histories can be slow; narrow by path or date range.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- git-log documentationEvidence: Documents the -S pickaxe option, which finds commits changing the number of matches.
Last verified: 2026-10-13 · Category: Developer