Git Simple Compare
Compare git branches and files with simple, editable diffs — right inside VS Code.
Marketplace ID: newdlops.gitsimplecompare
Install
- VS Code Marketplace: Git Simple Compare & Graph
- Command line:
code --install-extension newdlops.gitsimplecompare
- Manual VSIX: download or build a
.vsix, then run code --install-extension gitsimplecompare-0.1.72048.vsix
Previously installed newdlops.git-simple-compare? Disable or uninstall that
extension, then install this listing once. VS Code does not transfer automatic
updates between extension IDs. Your gitSimpleCompare.* settings remain available.
Features
- Compare branches — pick one branch to compare with the current checkout and review native editor line markers; an advanced command keeps explicit FROM/TO comparison available.
- Compare a file with a branch — right-click a file in the Explorer to diff it against a specific branch version.
- Compare the active file with a branch — diff the currently open file against a branch version from the editor title bar or context menu.
- Edit while comparing — in file-vs-branch diffs the working-tree side stays editable. You can also apply the whole left (branch) version to the right (working) file in one click.
- Git Graph — a visual commit graph across all branches. Click a commit to see its details (author, message, changed files), and click a file to open that commit's diff.
- Native conflict overlay — edit Result in the VS Code text editor while an in-editor overlay explains the exact Current/Incoming commits and rebase todo impact; native CodeLens actions remain available if the overlay cannot load.
- Interactive rebase — edit a rebase plan in a drag-and-drop webview (reorder + pick/reword/squash/fixup/drop). Launch it from the graph ("Rebase from here") or the command palette.
- Split changes into commits — pick individual diff hunks and commit them separately, repeating for the rest (a GUI for
git add -p).
- AI commit plans and messages — ask the local Claude Code or Codex CLI to split a large change set into reviewable commits, or generate a single commit message and staged PR title/body.
- Commit hook preview and management — run blocking hooks against the staged snapshot before committing, inspect/create/open/toggle traditional local hook files, and turn failed lint/file checks into clickable file-and-line diagnostics.
- Block author Code Vision — show the primary Git contributor above functions, classes, interfaces, methods, and blank-line-separated global declaration groups. Click the hint to open a line-aligned author/date column in the editor gutter.
- Pull request stack lifecycle — draw PR flow directly on the Git Graph and automate layer/worktree creation, descendant restacks, dependency-ordered submit/sync, and post-merge advancement.
- Safe VS Code cache cleanup — inspect regenerable workbench, renderer/GPU, webview, and extension-download caches by size, select what to remove, and keep settings, installed extensions, projects, workspace state, and backups intact.
- Stale local branch cleanup — select local branches whose names are absent from every configured remote, with worktree protection and a separate confirmation for unmerged history.
Usage
- Command Palette (
Cmd/Ctrl+Shift+P) → Git Simple Compare: Compare with Current Checkout...
- For arbitrary refs →
Git Simple Compare: Compare Any Two Branches (Advanced)...
- Explorer → right-click a file →
Compare This File with Branch
- Editor → right-click (or tab right-click) →
Compare Active File with Branch
- Editor title bar → comparison icon
- Activity Bar → Git Simple Compare icon to see the changed-files view
- Command Palette →
Git Simple Compare: Show Git Graph (or the graph icon in the Changes view toolbar)
Stale local branch cleanup
Open Changes → … → Local Branches & Stale Cleanup…, or run Git Simple Compare: Local Branches & Stale Cleanup… from the Command Palette. The panel lists every local branch by its local name, with stale status, matching remotes, worktree protection, and its latest commit. Search the list or choose Stale only to find cleanup candidates. Branches that exist on a remote or are in use stay visible with disabled selection controls.
The command queries every configured remote directly, so unfetched branches and outdated remote-tracking refs do not affect the result. A stale branch is a local branch with no matching name on any remote; age and upstream configuration do not define staleness. Without configured remotes, the panel still shows local branches and marks their status as Not checked.
Select the stale branches to remove, choose Review deletion, and confirm their names. Selected branches hidden by a search or filter are counted explicitly. Checked-out branches in any worktree are protected. Unmerged branches require a separate Force Delete confirmation. Remote availability, remote settings, branch tips and worktree use are checked again before deletion; failures and changed branches are reported in the Git Simple Compare OUTPUT channel. Remote branches and working files are preserved.
VS Code cache cleanup
Use the Clean VS Code Cache ($(clear-all)) action in the Git Simple Compare view title, or run Git Simple Compare: Clean VS Code Cache... from the Command Palette. The picker reports the approximate size of each regenerable cache group before a confirmation dialog. Active VS Code windows can recreate or lock cache files, so the result reports anything left behind and offers to reload the current window. In a Remote window, the command cleans the active remote extension host cache and explicitly leaves the local desktop cache alone.
The cleanup never targets user settings, installed extension directories, projects, User/workspaceStorage, backups, or extension global storage.
Block author Code Vision
For saved, tracked files, Git Simple Compare uses the active language extension's document symbols to place a dedicated CodeLens row above each supported source block. Top-level variables, constants, object declarations, and standalone type declarations are grouped until a blank line separates them, so each declaration group gets one CodeLens above its first line instead of one per line. Like IntelliJ Code Vision, the label shows the leading author, additional author count, last change date, and additional commit count. Tiny nested methods are folded into their parent block to reduce visual noise. Hover the Code Vision for the ownership distribution, or click any Code Vision to open a dedicated editor-gutter column showing the author name and date for every visible line in the file. The column stays aligned while scrolling, folding, and rendering CodeLens rows, and never inserts blame text into the source body. Hover, click or focus an entry for author identity, relative and exact dates, the complete commit message, co-authors and changed-file/line counts. The native-themed popup can open all commit changes, copy the full hash, open a supported remote commit page or show blame settings. Details load on demand and are shared between entries from the same commit. Click any Code Vision in the same file again to hide the column. Toggle the feature from the Changes toolbar or with Git Simple Compare: Toggle Block Author Code Vision; VS Code's editor.codeLens setting is also respected.
Block Author Code Vision is the single control for opening and toggling the
blame gutter. The older before-line labels, their toolbar switches and the
separate file-annotation show commands/shortcut have been removed to prevent
duplicate columns. Use Escape to close the gutter. View Line History in
the line-number menu, the editor menu
or a blame popup opens changes to the selected saved line and their file diffs.
Compact commit groups, cursor-commit highlighting and name/date/hash display
are available under gitSimpleCompare.blameAnnotations. See
Blame annotations and line history.
Git Graph
Opens a webview showing the commit history graph across branches. Click a commit node to view its details on the right; click any changed file to open that commit's diff. The graph loads commits lazily as you scroll until it reaches the first commit. Pull request stack layers appear as chips on their head commits with dashed arrows pointing to their parent commits.
View stash contents
Expand a saved stash in Changes → Stashes and select a file to open its
read-only diff. The stash's … menu offers View Stash Contents and
View Staged Stash Changes, including saved untracked files and staged changes
that differ from the saved working tree. Both commands are also available in the
Command Palette. Viewing leaves the working tree and stash unchanged.
Large pushes
Normal branch pushes automatically send commits oldest first when there are multiple outgoing commits on the first-parent chain and their new Git objects total at least 50 MiB before compression. Smaller pushes use one request. Changes, Git Graph, branch publication, PR publication and normal stack submission share this behavior. Push notifications show the current commit number; Git Simple Compare Output records each confirmed step. A failure or cancellation stops subsequent steps, keeps commits already received by the remote, and a retry reads the actual remote tip to continue. Each step checks the local source and destination and protects concurrent remote updates with an explicit lease. Merge commits carry their side history together; force pushes keep their existing single-update behavior. A single oversized commit or file is not split, and the estimate does not include Git LFS payloads.
Interactive rebase
From the Git Graph, select a commit and click Rebase from here (or run Git Simple Compare: Start Interactive Rebase…). Arrange the plan by dragging rows and choosing an action per commit — pick / reword / squash / fixup / drop. Requires a clean working tree and confirms before rewriting history. If conflicts occur, the rebase pauses and the Conflicts view takes over; resolve and Continue.
Conflict resolution
During a merge/rebase/cherry-pick/revert, the Conflicts view opens Result in the native VS Code text editor with a context overlay. It identifies the commits behind Current and Incoming, keeps Base available for reference, and writes editable text through a no-follow/CAS-backed virtual file system. Binary, symlink, deleted, submodule, and other special Results open as safe read-only native documents. During a rebase the overlay also shows the original branch tip, new base, active todo step, remaining commits that touch the same path, and whether later history can change the selected Result. Current/Ours is the accumulated rebase side; Incoming/Theirs is normally the replayed commit and is labeled from the active MERGE_HEAD/CHERRY_PICK_HEAD instead when a nested operation causes the conflict. Whole-file actions use exact Git stages, while CodeLens block actions edit only one complete conflict-marker block. The native 3-way merge editor remains available as an action. Use Continue / Abort in the Conflicts view after resolving the files.
PR operations paused in temporary worktrees use Continue PR Operation after
the files are resolved. Return to Working Tree keeps the recovery for later;
Resume a saved PR operation and resolve its conflicts reopens it after a
window reload. See PR operation recovery.
Squash applies the verified final PR delta, including connected merge histories,
so changes undone within the PR do not cause intermediate conflicts. Base updates
are excluded from the imported changes after checking the complete commit range.
Repeating a paused action reopens its saved work before fetching or recalculating.
Inspect PR prerequisites in the PR action menu checks candidate PRs before
applying. Apply-conflict notifications also identify candidates and link to their
reasons and simulated effect. The Conflicts toolbar can repeat the inspection
for a saved apply operation. See PR prerequisites.
Split changes into commits
Run Git Simple Compare: Split Changes into Commits. Select the diff hunks for the first commit, type a message, and commit; the remaining changes stay in your working tree so you can commit them separately. Requires no pre-staged changes (so each commit contains exactly what you select). New (untracked) files are not shown — git add them first.
AI commit and PR messages
The Changes view includes an AI button next to the commit message box. It sends the staged diff to the selected AI CLI, so stage the files or hunks you want summarized first. The staged PR preview also has an AI button that fills the PR title and body.
For a larger change set, enable AI Plan beside the commit button or run Git Simple Compare: AI Commit Plan. Add optional instructions such as “keep tests with implementation” or “separate documentation,” then review the proposed commit messages and file groups. You can edit messages, reorder commits, and move files between groups before approving execution. The panel clearly shows whether the plan covers staged changes only or all staged, unstaged, and untracked changes; it rechecks the snapshot before committing and leaves newer edits untouched. Planned messages follow the same subject/body guidance and commit prompt instructions as standalone AI commit messages.
If a planned commit fails, its numbered failure details include a Commit log preview. Use Hide log / Show log to collapse or expand it, and Copy log to copy the complete captured stdout/stderr even when the preview is shortened. Copy results appear beside the log; a failed copy leaves the output available for retry.
AI Plan prepares the complete commit chain privately, runs normal commit hooks for each prepared commit, then publishes the branch only after a final state check. Hooks can detect this provisional phase through GIT_SIMPLE_COMPARE_AI_PLAN_PROVISIONAL=1 and should defer irreversible notifications or deployments when it is set. Git hook side effects outside the repository cannot be rolled back if a later hook or concurrency check stops the plan.
This feature runs local CLIs non-interactively: claude -p for Claude Code and codex exec for Codex. Use Git Simple Compare: Configure AI CLI or the gear button beside the AI commit button to choose the provider, login/status flow, executable path, model/profile options, reasoning effort, default response language, and extra prompt instructions. Model and reasoning pickers load metadata from the installed provider CLI. The Commit Plan Settings group lets each provider use a separate model and reasoning effort only for AI Plan. Leaving either empty inherits that provider's general setting; if the general setting is also empty, the CLI default is used. Profile settings still apply, and the picker warns when CLI metadata explicitly marks the selected model as incompatible with the effective reasoning effort.
If a browser callback login cannot reach localhost, use a non-callback login method in AI CLI Settings: for Claude Code choose setup-token, console, or sso; for Codex choose device, api-key, or access-token. Then run Login / Status again.
The commit-message AI button is enabled only when there are staged changes. In PR preview, the copy button still copies the generated/current title and body, while Create Pull Request can publish the preview directly. Select a local source and target branch; if staged files are part of the preview, the extension asks for a commit message, commits only those staged files, performs a normal (never forced) push, then creates a ready or draft PR through gh. Unstaged and untracked files remain in the working tree. Existing PR previews keep the Open on GitHub action instead of creating a duplicate.
Commit hooks and failed checks
Click the shield beside the commit button to manage the repository's traditional file-based commit hooks. The panel honors core.hooksPath, linked worktrees, and Husky's .husky/_ layout. Git 2.55+ configured hooks declared through hook.* are not listed or changed. Safe toggles change only a regular Unix hook's executable bit; tracked/visible working-tree hooks, Husky proxy hooks, symbolic links, Windows hooks, and existing .disabled files remain open-for-editing but are not renamed or toggled.
Use Run commit hooks for staged changes in the same panel (or Git Simple Compare: Run Staged Commit Hooks) before committing. It runs pre-commit, followed by available prepare-commit-msg and commit-msg hooks when the commit message is not empty. Hooks see a sibling copy of the real index through GIT_INDEX_FILE, so ordinary git add calls do not update the real staged snapshot. Successful and failed stdout/stderr are written in full to the Git Simple Compare OUTPUT channel; failed file locations appear below the commit box with Run checks again. Hooks can detect this phase through GIT_SIMPLE_COMPARE_HOOK_PREFLIGHT=1.
The preview runs hooks in the real working directory so project tools and dependencies resolve normally. A hook can therefore still edit working-tree files or cause external side effects, and a hook that deliberately unsets or bypasses GIT_INDEX_FILE can alter the real index. Review any resulting changes and stage fixes before committing; the real commit runs its normal hooks again.
When a commit hook rejects a commit, common ESLint, TypeScript, Ruff, Prettier, pre-commit, Husky, and file-check output is shown below the commit box. Click a reported file to open its line, fix and stage it, then choose Retry commit. Show full output opens the unabridged process output in the Git Simple Compare OUTPUT channel.
The Changes view
- Toggle between tree and list layout from the view toolbar.
- Change the sort order (name / path / status) from the view toolbar.
- Click any file to open its diff.
Git Simple Compare uses its own Git CLI by default and leaves git.enabled, git.autorefresh, and git.autofetch as you configured them. With no repository open, Changes offers Clone Repository, Clone from GitHub, Open Repository, and Initialize Repository. The Source Control welcome provides Get Started with Git Simple Compare when native Git is enabled and the four setup actions when it is disabled. You can also use the command palette. GitHub cloning uses VS Code's GitHub sign-in independently of native Git. Setup connects the repository to Changes, including after opening a folder or adding it to the workspace.
The … menu's Reuse VS Code Git Status (User/Workspace) choices control only gitSimpleCompare.useBuiltinGitStatus. Workspace values override the user default. Opting in reuses native status when it is available; otherwise the extension continues using its own CLI. Existing git.enabled: false settings stay false and require no migration or window reload.
When built-in Git is disabled manually, Git Simple Compare supplies working-tree colors and status badges for the current workspace to the default Explorer, editor tabs, and Tab Manager's Explorer using the shared status cache. Saved edits, external file changes, staging, and commits refresh these decorations even while the Changes view is hidden. The Projects catalog does not trigger scans of other repositories. git.decorations.enabled and the Explorer's decoration preferences still apply. When only automatic refresh is paused, built-in Git retains ownership of its decorations; use Refresh in Source Control to update them.
Choose Git Startup / Executable… in the same menu to compare installed Git executables. The command checks git --version three times per candidate and shows the median startup time. Select a working candidate or enter a custom path, then save it for your user or this workspace. Reset Git executable setting… removes the selected scope's override. gitSimpleCompare.gitPath takes effect on the next Git command; workspace and folder values take precedence over the user default. On macOS, a direct Command Line Tools or Homebrew path can bypass a slow system launcher. This diagnoses startup time; repository work, remote requests and OS process delays require separate investigation. Results appear in Git Simple Compare Output.
Open Changes → … → Clean Idle Git Processes… to select eligible processes,
or run Git Simple Compare: Clean Idle Git Processes… from the Command Palette.
The manual command works while automatic cleanup is off. A monitor becomes
eligible after continuously observed inactivity; process age and low CPU alone
do not qualify it. Active repositories, other windows, writes and uncertain
process identities remain protected. Results and skipped candidates are logged
in Git Simple Compare Output. Monitor inspection currently supports macOS;
extension-owned read cancellation and deadlines also work on other platforms.
The same menu contains user and workspace automatic-cleanup toggles and
Idle Git Cleanup Settings…. Automatic cleanup defaults to off, the idle
interval to 5 minutes, and checks run once per minute when enabled. Workspace
and folder overrides take precedence over the user default.
On macOS, new builtin filesystem monitors started by this extension run as owned
foreground children and close with the extension, even when automatic cleanup
is off. Enabling automatic cleanup also recovers verified detached monitors
left by an earlier VS Code session after the observed idle interval. Open
workspaces, terminals and active Git operations remain protected.
Read-only Git commands have a configurable 30-second deadline. Status and
blame consumers share work, cancel obsolete reads, and release their private
caches on shutdown. Complete working-tree status uses a private index so repeated
scans can reuse metadata without changing the real staged state. Tab Manager
0.1.6619 or later can share that status instead of launching a separate query.
These controls reduce extension-generated work; system memory pressure and OS
process-execution delays can still affect Git latency.
Pull request stacks
Open the layer button in the Git Graph toolbar to see a unified view of local parent metadata and GitHub PR base/head relationships. Add Layer creates a child branch and optional linked worktree from the selected parent. Restack previews and rebases that layer and all descendants with per-layer safety refs and integrated conflict Continue/Abort. Submit / Sync pushes root-to-leaf, creates missing PRs, updates existing bases and stack sections in PR bodies, and uses an explicit force-with-lease only for rewritten remote history. After a lower PR is merged, Advance promotes its children to the previous base, restacks and syncs their PRs, then offers safe local branch/worktree cleanup.
Install gh and run gh auth login before submitting. For a complete Korean walkthrough, see PR Stack 사용 가이드.
Apply Left → Right
While a file-vs-branch diff is focused, the editor title bar shows an Apply Left to Right (→) button. It replaces the whole working file with the branch version. The change is applied as an editor edit, so you can review, undo, or tweak it before saving.
Language
The UI defaults to English. When VS Code's display language is set to Korean (ko), all commands and messages switch to Korean automatically. Use "Configure Display Language" from the Command Palette to change it.
Settings
| Setting |
Default |
Description |
gitSimpleCompare.gitPath |
empty |
Git executable name or absolute path; empty uses git from PATH. Supports user, workspace and folder overrides |
gitSimpleCompare.gitProcessCleanup.enabled |
false |
Clean unused owned reads and verified inactive Git monitors, including detached monitors from earlier sessions; supports user, workspace and folder overrides |
gitSimpleCompare.gitProcessCleanup.idleMinutes |
5 |
Observed idle interval before cleanup, from 1 to 1440 minutes |
gitSimpleCompare.gitReadTimeoutSeconds |
30 |
Read-only command deadline; 0 disables it. Writes and hooks are protected |
gitSimpleCompare.workingTreeStatusCache |
true |
Share complete status using an extension-owned private index cache |
gitSimpleCompare.cancelUnusedGitReads |
true |
Cancel shared status and blame reads after their last consumer leaves |
gitSimpleCompare.diffBase |
twoDot |
Branch diff base (twoDot = direct, threeDot = common ancestor) |
gitSimpleCompare.includeRemoteBranches |
true |
Include remote branches in the branch picker |
gitSimpleCompare.blameBlock.show |
true |
Show clickable contributor Code Vision above source blocks |
gitSimpleCompare.aiCliProvider |
auto |
AI CLI provider (auto, claude, or codex) |
gitSimpleCompare.aiClaudeCommand |
claude |
Claude Code executable name or absolute path |
gitSimpleCompare.aiClaudeModel |
empty |
Claude Code model selected from CLI metadata |
gitSimpleCompare.aiClaudeCommitPlanModel |
empty |
Claude Code model used only for AI Plan; empty inherits aiClaudeModel, then the CLI default |
gitSimpleCompare.aiClaudeCommitPlanEffort |
low |
Claude Code reasoning effort used only for AI Plan; empty inherits aiClaudeEffort, then the CLI default |
gitSimpleCompare.aiClaudeEffort |
empty |
Claude Code reasoning effort (low, medium, high, xhigh, or max) |
gitSimpleCompare.aiClaudeSystemPrompt |
empty |
Optional Claude Code system prompt appended with --append-system-prompt |
gitSimpleCompare.aiClaudeLoginMode |
claudeai |
Claude login method (claudeai, console, sso, or setup-token) |
gitSimpleCompare.aiCodexCommand |
codex |
Codex executable name or absolute path |
gitSimpleCompare.aiCodexModel |
empty |
Codex model selected from the CLI model catalog |
gitSimpleCompare.aiCodexCommitPlanModel |
empty |
Codex model used only for AI Plan; empty inherits aiCodexModel, then the CLI default |
gitSimpleCompare.aiCodexCommitPlanReasoningEffort |
low |
Codex reasoning effort used only for AI Plan; empty inherits aiCodexReasoningEffort, then the CLI default |
gitSimpleCompare.aiCodexReasoningEffort |
empty |
Codex reasoning effort (low, medium, high, xhigh, or max when supported) |
gitSimpleCompare.aiCodexProfile |
empty |
Optional Codex config profile passed with --profile |
gitSimpleCompare.aiCodexLoginMode |
device |
Codex login method (device, browser, api-key, or access-token) |
gitSimpleCompare.aiResponseLanguage |
English |
Language for AI-generated messages |
gitSimpleCompare.aiCommonInstructions |
empty |
Extra prompt instructions applied to commit plans, commit messages, and PR generation |
gitSimpleCompare.aiCommitInstructions |
empty |
Extra prompt instructions applied to standalone and planned commit messages |
gitSimpleCompare.aiPullRequestInstructions |
empty |
Extra prompt instructions applied only to PR generation |
gitSimpleCompare.aiCliTimeoutMs |
120000 |
Timeout for AI CLI requests |
Development
npm install
npm run compile # bundle
npm run watch # incremental build
npm run check-types # type check
npm test # hook parser and temporary-repository integration tests
Press F5 in VS Code to launch the Extension Development Host.
Coding agents
Codex reads AGENTS.md from the repository root. Claude Code reads CLAUDE.md; this repository keeps CLAUDE.md as a small import of AGENTS.md so both agents follow the same project rules. Put personal Claude Code notes in CLAUDE.local.md; it is ignored by git.
Publishing
Release packaging uses publisher newdlops. See docs/publishing.md for the Marketplace checklist.
License
MIT