Git Account Switcher for VS Code
Easily manage and switch between multiple Git configurations and GitHub CLI accounts directly from VS Code.
Features
- Switch Account: Quickly swap your
git config (user.name, user.email) and gh (GitHub CLI) account.
- Add Account: Wizard to add new accounts (auto-detects from system or manual entry).
- Status Bar: Always see which Git account is currently active.
- Support for Local/Global: Choose to apply git config changes globally or just for the current repository.
Requirements
- Git: Must be installed.
- GitHub CLI (gh): Required for switching GitHub accounts.
Usage
- Open the Command Palette (
Cmd+Shift+P / Ctrl+Shift+P).
- Type
Git Account Switcher.
- Select Add Account to configure your personal/work profiles.
- Select Switch Account to toggle between them.
Extension Settings
This extension reads/writes to ~/.git-accounts.json, making it compatible with the Git Account Switcher CLI tool.
Publishing to Open VSX
To publish this extension:
- Install
ovsx: npm install -g ovsx
- Package:
vsce package
- Publish:
ovsx publish git-account-switcher-1.0.0.vsix -p <token>
| |