A Visual Studio Code extension to easily view, manage, and switch Git user identities (user.name and user.email) locally per repository, with support for profile saving, editing, deletion, and remote pattern matching.
Features
Identity & Status Check (gitAccountSwitcher.status):
Validates if the active workspace is a Git repository.
Checks local user.name and user.email overrides, with automatic fallback to global Git configuration.
Displays identity information, active scope, and quick switch actions.
Interactive QuickPick menu with saved accounts (Work, Personal, Open-Source, etc.).
Instantly applies settings locally (git config --local user.name and user.email), isolating changes to the current repository.
Secure persistent storage using context.globalState.
Add, edit, or delete stored profiles on the fly.
Status Bar Integration:
Real-time indicator showing the active Git user and scope in VS Code's status bar.
Automatic Account Detection:
Automatically matches remote repository URLs (origin) against pattern definitions (e.g. github.com/my-company) to prompt or apply the correct identity.
Extension Settings
This extension contributes the following settings:
gitAccountSwitcher.autoDetectOnOpen: Automatically check remote repository URL on workspace open to suggest or apply matching Git profiles (default: true).
gitAccountSwitcher.showStatusBar: Show the active Git user profile in the VS Code status bar (default: true).
Development
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Run in watch mode
npm run watch