Repo Manager by Sachila
Check out a common branch across selected Git repositories in your current VS Code window, creating it wherever it does not exist.
Preview locally
- Use Node.js 22 or newer for development. Run
npm install and npm test.
- Open this project in VS Code and press F5 (Preview Repo Manager).
- In the Extension Development Host, open a Git repository and use File → Add Folder to Workspace… to add more repositories.
- Click the Repo Manager activity bar icon, or run Repo Manager: Open Repo Manager from the Command Palette.
- Select repositories, enter a new branch name, and click Checkout branch.
For an isolated preview with three disposable repositories, run npm run preview. Run npm run preview:vsix to package, install and launch the VSIX in a separate temporary profile. Accept workspace trust only for this generated preview workspace. These commands leave your regular VS Code extensions and repositories alone.
You can also run npm run package, then use Extensions: Install from VSIX… to install repo-manager-0.1.0.vsix. The Marketplace publisher ID is Sachilaranawaka.
How it works
The extension discovers repositories through VS Code’s built-in Git integration. For each selected repository, an existing local branch uses git checkout <branch name>. A missing local branch uses git checkout -b <branch name>, starting from that repository’s current HEAD. A selection can contain both cases. No fetch, pull, push, or remote branch creation occurs.
All selected repositories are validated before changes begin. Invalid names, branch path conflicts, unresolved conflicts, in-progress Git operations, and repositories without commits block the operation.
Stash and re-apply is enabled by default. Tracked and untracked changes are stashed, then restored on the target branch with staged state preserved. Ignored files remain in place. Only the exact stash created by the operation is removed after successful restoration; existing stashes are preserved.
If you disable this checkbox, you must confirm permanent removal of staged and unstaged tracked changes in the listed repositories. This includes newly staged files. Untracked and ignored files are preserved.
Repositories are processed sequentially. On failure, processing stops and remaining repositories are skipped. Successful repositories stay on their target branches. If checkout fails, the extension attempts to restore changes on the original branch. If stash application conflicts, the stash is retained and recovery details appear in the sidebar. Inspect and resolve the repository before applying or dropping the recovery stash; do not blindly re-apply a partially applied stash.
Requirements and limitations
- Desktop VS Code 1.90 or newer, with Git installed and built-in Git integration enabled.
- A trusted workspace containing one or more repositories with commits.
- Remote SSH, WSL, and containers run Git on the remote extension host.
- Separate VS Code windows, virtual repositories, and browser-only VS Code are not supported.
- Multi-repository changes are not atomic. Concurrent Git operations can still cause failures after validation. Avoid editing repositories or running other Git operations during execution.
- Git hooks and local Git configuration can affect checkout and restoration.
Development
npm run compile: compile TypeScript.
npm run watch: compile continuously.
npm test: integration tests against disposable local Git repositories.
npm run package: build an installable VSIX.
See PREVIEW.md for the preview checklist and PUBLISHING.md for release steps in the source project.
MIT license.