Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>Branch HarborNew to Visual Studio Code? Get it now.
Branch Harbor

Branch Harbor

Sahitya Patel

| (0) | Free
Pull, push, sync and manage local Git branches without switching your working branch.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Branch Harbor

VS Code Marketplace Installs CI License: MIT

Manage your Git branches without leaving the one you are working on.

Branch Harbor adds a VS Code sidebar that shows every local branch with its sync status. Pull, push, and sync any branch, not just the current one, while your working files, index, and checked-out branch stay untouched. No temporary checkout, no hidden stash.

Branch Harbor sidebar showing local branches with sync status and filtered remote branches

Requirements

  • VS Code 1.103+ on Windows, macOS, or Linux, with the built-in Git extension enabled.
  • Git 2.31+ and working Git authentication (credential helper or SSH agent).
  • A trusted, local workspace containing a Git repository. Remote SSH, WSL, and dev containers work; browser-only and virtual workspaces do not.

Get Started

  1. Install Branch Harbor from the VS Code Marketplace: search for it in the Extensions view, or run code --install-extension sahityapatel.branch-harbor. You can also download the .vsix from Releases (or build it) and use Extensions > ... > Install from VSIX.

  2. Open a repository and select Branch Harbor in the Activity Bar.

  3. Select Refresh (next to Search) to fetch remote branches.

  4. Work with a branch:

    • Hover for Pull, Push, Sync, and Copy Branch Name.
    • Click for the action picker.
    • Right-click for the full menu.

    Every action is also in the Command Palette.

Branch action picker listing Checkout, Pull, Push, Sync, Publish, Rename, Force Delete, Merge into Current, and Create Branch From

Finding branches

  • Remote branches stay hidden until you filter them. Select the filter icon on Remote Branches and type part of a name. Matching is case-insensitive and results are newest first. The filter applies to all repositories for the session; clear it to hide remote branches again.
  • Search (magnifier icon) lists local and remote branches across repositories, newest first. Remote results appear once you type. Picking a result reveals it in the tree without checking it out; picking a remote result also applies your text as the remote filter. Search uses the last fetched refs, so refresh first to see new remote branches.

Search picker showing local and remote branches matching "feat", newest first

Multi-root workspaces show one group per repository, with the current branch first. The view supports keyboard navigation, screen readers, and light, dark, and high-contrast themes. To enlarge the UI, use Zoom In / Zoom Out (Entire VS Code Window) from the Command Palette. These zoom all of VS Code, not just this view.

Actions

Action What it does
Checkout Switch to a local branch, or create a named tracking branch from a remote one. Needs a clean working tree.
Pull Fetch the upstream and fast-forward the branch. Never switches branches.
Push Push the branch to its upstream. Never force-pushes.
Sync Pull (fast-forward), then push. Stops if histories have diverged.
Publish Push to a remote you choose under the same name and set upstream tracking.
Create Branch From Create a local branch from any listed branch without checking it out.
Rename Rename an inactive local branch. Never overwrites a branch or renames the remote one.
Force Delete Delete an inactive local branch, even if unmerged, after a Yes/No prompt. Never deletes the remote branch.
Merge into Current Merge a local or remote-tracking branch into the current branch.
Copy Branch Name Copy a local or remote branch name.
Search Find local and remote branches across repositories.
Refresh Fetch and prune remote-tracking refs, then reload status. Never changes local branches, tags, or files.
  • Push and Sync always target the branch's upstream (shown in its tooltip), even if push.default, pushRemote, or a push refspec would choose a different branch. The remote's push URLs still apply.
  • Only Force Delete asks for confirmation. Other actions run as soon as you supply the required input. Progress shows in the status bar, and errors explain what to do next.
  • To change tracking outside Publish, use standard Git commands.

Sync Status

Label Meaning
Up to date Matches the last fetched upstream.
N ahead N local commits to push.
N behind N upstream commits to pull.
N ahead, M behind (diverged) Both sides have new commits; Sync is blocked.
Not published No upstream configured. The branch may still exist on the remote.
Upstream missing Tracking is configured, but the remote branch is gone.
Current / Worktree Checked out here / in another worktree.
  • Status comes from the last fetch, not a live server query. Git changes and window focus reload local status but don't fetch.
  • Refresh also runs automatically every hour, even when the sidebar is hidden. Nothing is ever pulled or pushed automatically.
  • Hover a repository or branch to see when it was last refreshed. Background refresh failures are logged and briefly shown in the status bar.
  • Committed 2 days ago is the age of the branch's latest commit, not when the branch was created or pushed. Hover for the exact date.

Safety and Limitations

  • Nothing destructive: no force push, no remote branch deletion, no reset, no history rewriting, no automatic stash. Only Checkout ever switches branches.
  • Fast-forward only: pulls on other branches only fast-forward. Resolve divergence yourself with merge or rebase in that branch's worktree.
  • Clean tree required: Checkout, pulling the current branch, and Merge need a clean index and working tree (including untracked files). Save your editors first.
  • Merge conflicts: Merge may create a merge commit. Conflicts stay in Source Control for normal resolution; git merge --abort cancels.
  • Failed Sync: if the push fails after a successful pull, the pull is kept. Check the status and push again.
  • Worktrees: branches checked out in another worktree can be pushed, but not pulled, renamed, deleted, or checked out here.
  • Remote checkout: filter remote branches, then choose Checkout on the remote row (the Command Palette lists only local branches). It creates a new tracking branch from the cached remote ref, and never fetches or overwrites an existing local branch.
  • One operation at a time per repository within Branch Harbor. Avoid running branch-changing commands in other tools at the same time.
  • Your Git config applies: hooks, signing, credential helpers, and transport settings all stay active. Complete any interactive sign-in outside the extension first.
  • Not supported: mirror remotes, and upstreams that point to a local branch (remote = .). Detached HEAD can manage other branches but can't be a merge target. Repositories with no commits show an empty view until the first commit.

Settings

Setting Default Meaning
branchHarbor.gitTimeoutSeconds 120 Per-command timeout (10–1800 seconds). Reload the window after changing.

Troubleshooting

Problem What to do
Authentication failed Sign in with your Git credential manager or SSH agent, then retry. Branch Harbor never prompts for or stores credentials.
Pull refused Check ahead/behind status and whether another worktree has the branch. Resolve divergence, or commit or stash work before updating the current branch.
Git timed out Check git status before retrying, because the operation may have finished. Increase branchHarbor.gitTimeoutSeconds for large repositories.
No repositories Enable the built-in Git extension, trust the workspace, and open a repository folder. Discovery follows VS Code's Git settings.

For details, run Branch Harbor: Show Git Output. It logs Git commands and sanitized errors, never file contents. It can still include paths and branch names, so review it before sharing.

Development

Requires Node.js 22.18+ and Git 2.31+.

git clone https://github.com/sahitya0000/BranchHarbor.git
cd BranchHarbor
npm ci
npm run verify      # type check, tests, and bundle
npm run test:host   # smoke test in a downloaded VS Code
npm run package     # build branch-harbor-<version>.vsix
  • On Windows, .\build.ps1 does a clean install, verification, and packaging in one step. It first deletes existing *.vsix files and never publishes.
  • Press F5 in VS Code to launch an Extension Development Host. npm run watch rebuilds on change.
  • Tests use temporary local repositories and never push to a real remote.
  • The VSIX contains only the bundled extension, icons, manifest, and docs. It has no runtime npm dependencies and no telemetry.

See Architecture, Testing, and Publishing for details.

Contributing

Contributions are welcome. Please read CONTRIBUTING.md and the Code of Conduct. For help, see SUPPORT.md. Report vulnerabilities privately as described in SECURITY.md.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft