Git Log Pickaxe
Search your git history for a string using git log -S (pickaxe) — scoped to the active file.
Find exactly which commits introduced or removed a specific string, function name, variable, or any text.
Features
- Pickaxe search (
-S) — shows commits where the string count changed (introduced or removed)
- Regex search (
-G) — shows commits where the expression appears anywhere in the diff
- Search history — last 10 searches are saved and offered as quick picks
- Diff view — open any found commit as a side-by-side diff directly in VS Code
- GitHub PR links —
#123 references in commit messages become clickable links
- Multi-root workspace support — each file finds its own git repository
- Three ways to trigger — Explorer context menu, tab context menu, or editor title button
Usage
- Open a file that is part of a git repository
- Trigger the command via one of:
- Right-click the file in the Explorer → Git: Git Log: Pickaxe Search
- Right-click the editor tab → Git: Git Log: Pickaxe Search
- Click the search icon in the editor title bar
- Open the Command Palette (
Ctrl+Shift+P) → Git Log: Pickaxe Search
- Choose the search mode (
-S exact string or -G regex)
- Enter a search string (or pick from your recent searches)
- Results appear in the Git Log Pickaxe output panel
- Optionally open one or more commits as a diff view
Requirements
git must be installed and available in your system PATH
- The file must be inside a git repository
Output example
======================================================================
Git Log Pickaxe: "getUserById"
Mode: git log -S (exact string)
File: src/services/userService.ts
Repository: /home/user/projects/myapp
======================================================================
a3f2c1d 2024-11-15 Max Mustermann feat: add user service
7b8e9f0 2024-10-03 Anna Schmidt refactor: rename getUser to getUserById
Release Notes
See CHANGELOG.md.
| |