A practical guide to using Git's built-in search capabilities to track down commits by code content. Covers `git log -S` (the pickaxe option) to find commits where a specific string was added or deleted, `git show --stat` to get a high-level view of what a commit touched, and combining these tools to efficiently navigate large commit histories like Next.js. Includes tips for crafting effective search queries using surrounding syntax, and notes on the regex-based `-G` alternative and performance considerations.
Table of contents
Running Git blame on a piece of codeSearching for commits by codeUsing git log -S in larger codebasesCommits at a glanceEffective use of -SPerformanceFinal wordsSort: