Search within your Git branch changes — find code in the lines you actually changed, not the entire codebase.
The Problem
When working on a feature branch, you often need to find code you recently wrote. VS Code's built-in search returns results from the entire codebase, forcing you to wade through unrelated code.
GitDiffSearch solves this by searching only within the added and modified lines of your branch compared to main/master.
Features
Core Search
🔍 Search in changed lines — Find code in additions and deletions from your branch diff
🎯 Click to navigate — Jump directly to the line in your file or view the diff
⚙️ Search options — Case-sensitive, regex, whole word matching
🌿 Branch selector — Compare against any branch
File Tree View
🌲 Visual file tree — See all changed files organized by folder
📊 Inline search results — Matching diff lines appear under each file
🏷️ Working tree status — Colored dots show git state: amber (unstaged), blue (staged), gray (committed)
⭐ Favorites — Star important files for quick access
🎯 Active file highlight — Currently open file is highlighted in the tree
Powerful Filters
📁 Filter by status — Show only added, modified, or deleted files
🔵 Filter by git state — Show only unstaged, staged, or committed files
📄 Filter by file type — Focus on .ts, .tsx, .css, etc.
🔍 Glob patterns — Filter with patterns like *.ts, src/**/*.tsx, or !**/test/**
🚫 Exclude filters — Cmd+Click any filter to hide matching files instead
🔤 Smart search prefix — Use file: to filter by filename
📈 Live count — Shows "5 of 20 files" when filters are active
Multi-Workspace Support
📂 Multiple repositories — Switch between repos in multi-root workspaces
🔀 Per-folder branches — Each workspace folder remembers its base branch
Stay Up to Date
⚠️ Rebase warning — Banner alerts when base branch has new commits
🔄 Auto-refresh — Detects rebases, merges, and file changes automatically
Quick Start
Open a Git repository in VS Code
Press Cmd+Shift+D (Mac) or Ctrl+Shift+D (Windows/Linux) to open the sidebar
Or press Cmd+Shift+T (Mac) or Ctrl+Shift+T (Windows/Linux) to open as a panel
Or find it in the Source Control panel as a collapsible section
Type your search query to find code in your diff
Click a result to jump to that line
Search Tips
Search
Description
useState
Find "useState" in diff content
file:Button
Filter files containing "Button" in the name
TODO + filter A
Find TODOs you added (not existing ones)
Glob: src/**/*.tsx
Show only TSX files in src folder
Glob: !**/test/**
Hide all test files
Use Cases
"Where did I add that function?" — Search for the function name in your branch changes
"Find all TODOs I added" — Search for TODO with additions filter
"What did I remove?" — Filter by deletions to see removed code
"PR review prep" — Quickly find specific changes before submitting
"Focus on one file type" — Filter to only .tsx files you modified
"Hide test files" — Cmd+Click on .test.ts filter to exclude tests from view
"Working on multiple repos" — Switch between workspace folders with one click
Configuration
Setting
Description
Default
gitDiffSearch.defaultBaseBranch
Base branch to compare against
Auto-detects (main/master)
Keyboard Shortcuts
Shortcut
Action
Cmd+Shift+D / Ctrl+Shift+D
Open GitDiffSearch sidebar
Cmd+Shift+T / Ctrl+Shift+T
Open GitDiffSearch panel
↑↓
Navigate files
←→
Collapse/expand folders
Enter
Open file
Click
View side-by-side diff
Cmd+Click / Ctrl+Click
Open file directly
Cmd+Shift+Click / Ctrl+Shift+Click
Toggle favorite
Cmd+Click / Ctrl+Click on filter
Exclude filter (hide matching files)
Requirements
Git 2.0+
VS Code 1.74.0+
Comparison with Other Tools
Feature
GitDiffSearch
VS Code Search
GitLens
Search in diff content
✅
❌
❌
Visual file tree
✅
❌
✅
Filter by change status
✅
❌
❌
Multi-root workspace
✅
✅
✅
Rebase reminder
✅
❌
❌
Search commit history
❌
❌
✅
GitDiffSearch is focused on one thing: finding code within your branch changes.
Feedback
Found a bug or have a feature request? Leave a review on the VS Code Marketplace.