Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>DriftGuardNew to Visual Studio Code? Get it now.
DriftGuard

DriftGuard

Kanaihya Kumar

| (0) | Free
See which lines in the file you are editing were changed on other git branches, so you can spot overlap and avoid merge conflicts before they happen.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

DriftGuard

See which lines in the file you are editing were changed on other git branches, so you can spot overlap and avoid merge conflicts before they happen.

While you work on your branch, teammates keep committing to theirs. DriftGuard quietly scans the most recently committed local and remote branches, finds the files they changed since their merge base with your HEAD, and surfaces that drift right where you need it: in the editor, in a tree view, and in the status bar.

Features

Editor highlights

  • Lines that were modified on another branch get a subtle, theme-aware whole-line highlight with a marker in the overview ruler.
  • Hover a highlighted line to see the branch name, the last commit author, the date, and the commit subject.
  • If the same lines are also modified in your working tree, the highlight escalates to a warning color and the hover says "Potential conflict" -> you are both editing the same region.

Drift tree view

  • Found in the Source Control sidebar: each branch is listed with a count of the files it changed (branch -> changed files).
  • Files you have also edited locally are marked with "(edited locally)".
  • Click a file to open a side-by-side diff between your HEAD version and that branch's version.

Status bar

  • Shows "Drift: N files" with the total number of files changed on other branches.
  • Turns warning-colored when any of those files overlap your local edits.
  • Hover for the top branches ranked by overlap; click to open the DriftGuard view.

Git engine

  • Enumerates local and remote branches with git for-each-ref, sorted by most recent commit.
  • Skips the current branch, fully merged branches, and anything matching your ignore globs.
  • For each candidate branch it computes the merge base with HEAD and diffs merge-base -> branch to find changed files and hunk-level line ranges.
  • Results are cached and refreshed on command, on save, and on a configurable interval.
  • Runs git as a child process without ever blocking the UI, and degrades gracefully when git or a repository is missing.

Commands

All commands live under the "DriftGuard" category in the Command Palette.

Command What it does
DriftGuard: Refresh Now Rescan branches and update all indicators
DriftGuard: Set Base Branch Pick the base branch used as a fallback merge target
DriftGuard: Open Diff for Current File Pick a branch that touched the current file and open the diff
DriftGuard: Toggle Inline Decorations Show or hide the editor highlights

Settings

Setting Default Description
driftGuard.baseBranch "" Fallback merge target; empty auto-detects origin/main or origin/master
driftGuard.ignoreBranches ["origin/HEAD"] Glob patterns for branch names to skip, e.g. release/*
driftGuard.maxBranches 10 How many of the most recently committed branches to scan
driftGuard.refreshMinutes 5 Automatic rescan interval in minutes; 0 disables it
driftGuard.showDecorations true Show inline editor decorations

Getting started

  1. Open a folder that contains a git repository with at least one branch besides the current one.
  2. DriftGuard activates automatically and runs a first scan.
  3. Run "DriftGuard: Refresh Now" any time, or let the interval do it for you.
  4. Follow the "Get Started with DriftGuard" walkthrough (Help -> Welcome -> Walkthroughs) for a guided tour.

How it works

For each candidate branch, DriftGuard computes the merge base with your HEAD and asks git which files changed between them (merge-base -> branch). For files you have open, it maps the branch's diff hunks onto line ranges and compares them with your uncommitted edits (git diff HEAD). Ranges that intersect are flagged as potential conflicts. Line positions are anchored at the merge base, so they are an approximation when your own edits have shifted lines.

Requirements

  • VS Code 1.85.0 or higher
  • git installed and on your PATH
  • A git repository in the first workspace folder, with at least one branch besides the current one

If any of these are missing, DriftGuard stays quiet: the tree view explains what is needed and no error notifications are spammed.

Author

Kanaihya Kumar - kanaihyakmr@gmail.com

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft