Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>Align BranchesNew to Visual Studio Code? Get it now.
Align Branches

Align Branches

Andrew Yacoub

|
1 install
| (0) | Free
Finds fixes that exist on your staging branch but never reached master.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Align Branches

Finds fixes that live on your staging branch but never reached master — the bugs that are resolved in staging and silently still broken in production.

The problem

You branch from master, cherry-pick into a staging branch, then fix the bugs staging surfaces on the staging branch. Some of those fixes never get copied back. Staging is green, production still has the bug, and nothing tells you.

git cherry origin/master origin/staging is the one-liner that finds these, but it compares patch IDs, so on a real repository most of its output is noise from rebases, adapted ports and other people's work. This extension is that command plus the checks that make the output small enough to act on.

What it does

  • Panel in the Source Control sidebar listing every unported commit, with the reason each was flagged.
  • Status bar counter, highlighted when something is missing.
  • Click a commit to open a side-by-side diff of the two branches for the files it touched — upstream left, downstream right. Contents are read straight out of git through a virtual alignbranches: scheme, so nothing touches your worktree and it works mid-edit.
  • Compare all differing files between the two branches, labelled only on staging / only on master / differs.
  • Port a commit in one action: creates a branch off upstream and cherry-picks with -x.

How commits are classified

Meaning
Missing No equivalent change found upstream. This is the leak.
Suspect An upstream commit shares the ticket, touches the same files, and isn't older. Probably a port that was rewritten during conflict resolution — check it.
In flight Cherry-picked from a branch that exists but hasn't merged upstream yet. Not lost, unless that branch is abandoned.

A commit is cleared when its patch matches upstream, when a cherry-pick -x footer links it to an upstream commit in either direction, when its message carries a marker like [staging-only], or when it's on the ignore list.

Only your commits

If your branches are rebased onto their bases, they carry the whole team's history and the raw diff is unusable. The panel shows only commits you authored by default, resolved from git config user.email. The person icon in the panel title toggles to everyone's.

Addresses must match exactly rather than as substrings — otherwise a@company.com would match fatma@company.com and quietly attribute a colleague's commits to you. Rebasing preserves the commit author (it only rewrites the committer), so your commits stay yours through any number of rebases.

Configuration

Create .alignbranches.json in your repository root:

{
  "pairs": [{ "from": "origin/staging", "to": "origin/master" }],
  "authors": ["me"],
  "ignoreMarkers": ["[no-backport]", "[staging-only]"],
  "lookbackDays": 90
}

With no config file it defaults to origin/staging → origin/master and works immediately if your branches are named that.

Settings: alignBranches.authors, alignBranches.autoRefresh, alignBranches.refreshIntervalSeconds, alignBranches.fetchOnRefresh, alignBranches.showStatusBar.

First run

An established repository will show years of accumulated drift. Run Align Branches: Accept all current drift from the Command Palette to set a baseline, commit .alignbranches.json, and only new drift is reported after that.

A note on what this is for

The extension is a safety net, not the fix. The fix is direction: write bug fixes on a branch off master and cherry-pick forward into staging, so staging is strictly downstream and nothing can be stranded there. If this panel is regularly full, that's the process telling you something.

The same detection core also runs as a CLI, a pre-push hook and a CI gate — an editor panel only helps when you happen to look at it, while a blocked merge stops a release. See the project repository.

Requirements

Git, and a full clone. Patch comparison needs real history; on a shallow clone every commit looks unported (the extension warns when it detects this).

License

MIT

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