Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>GitSmash - Multi Git Config ManagerNew to Visual Studio Code? Get it now.
GitSmash - Multi Git Config Manager

GitSmash - Multi Git Config Manager

Anish Shekh

| (0) | Free
Manage and switch between multiple git configurations with ease
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GitSmash - Multi Git Config Manager

A minimal yet powerful VS Code extension for managing and switching between multiple git configurations. Perfect for developers who work with different git identities across projects.

Features

  • Store Multiple Configs: Save unlimited git configurations with unique names
  • Quick Switching: Switch between configs with a single click
  • Flexible Scope: Apply configs locally (per repository) or globally (all repositories)
  • Status Bar Indicator: Always see your current git user at a glance
  • Tree View Sidebar: Visual interface for managing all your configs
  • Full CRUD Operations: Add, edit, delete, and list configurations
  • Current Config Detection: Automatically highlights the active configuration

Installation

From Source

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Run npm run compile to compile TypeScript
  4. Press F5 in VS Code to launch Extension Development Host
  5. Test the extension in the new window

From VSIX (Local Installation)

  1. Package the extension: vsce package
  2. Install: code --install-extension gitsmash-0.1.0.vsix
  3. Reload VS Code

Updating the Extension

After making changes to the source code:

Quick update:

./update-extension.sh

Manual update:

code --uninstall-extension gitsmash.gitsmash
npm run compile && vsce package
code --install-extension gitsmash-0.1.0.vsix

Then reload VS Code: Cmd+Shift+P → "Developer: Reload Window"

See UPDATE.md for detailed instructions.

Usage

Adding a Configuration

  1. Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  2. Type "GitSmash: Add Git Config"
  3. Follow the prompts to enter:
    • Unique key (e.g., "work", "personal")
    • Display name
    • Git user name
    • Git user email
  4. Choose whether to apply it immediately

Or click the "+" button in the GitSmash sidebar.

Switching Configurations

Method 1: Status Bar

  • Click the git config indicator in the status bar
  • Select a configuration
  • Choose scope (Local or Global)

Method 2: Command Palette

  • Run "GitSmash: Switch Git Config"
  • Select a configuration
  • Choose scope (Local or Global)

Method 3: Tree View

  • Open the GitSmash sidebar
  • Click on any configuration to switch to it

Editing a Configuration

  1. Open Command Palette
  2. Run "GitSmash: Edit Git Config"
  3. Select the configuration to edit
  4. Choose which field to modify
  5. Enter the new value

Or right-click a config in the sidebar and select "Edit".

Deleting a Configuration

  1. Open Command Palette
  2. Run "GitSmash: Delete Git Config"
  3. Select the configuration to delete
  4. Confirm the deletion

Or right-click a config in the sidebar and select "Delete".

Listing All Configurations

  1. Open Command Palette
  2. Run "GitSmash: List All Git Configs"
  3. View all saved configurations with details
  4. Select one for quick actions

Commands

Command Description
GitSmash: Switch Git Config Switch to a different git configuration
GitSmash: Add Git Config Add a new git configuration
GitSmash: Edit Git Config Edit an existing configuration
GitSmash: Delete Git Config Delete a configuration
GitSmash: List All Git Configs View all saved configurations

UI Components

Status Bar

Shows your current git user in the bottom-left corner:

  • $(git-branch) John Doe (local) - Active local config
  • $(git-branch) Personal (global) - Active global config
  • $(git-branch) No git config - No config set
  • $(git-branch) Not a git repo - Current workspace isn't a git repository

Click the status bar item to quickly switch configs.

Tree View Sidebar

Located in the Activity Bar with a git branch icon:

  • Shows all saved configurations
  • Active config marked with a green checkmark
  • Displays email address as description
  • Right-click for context menu (Edit, Delete)
  • Click any config to switch to it

Scope: Local vs Global

Local (Recommended)

  • Applies to the current repository only
  • Uses git config --local
  • Stored in .git/config of your repository
  • Different repos can have different configs

Global

  • Applies to all repositories on your machine
  • Uses git config --global
  • Stored in ~/.gitconfig
  • Affects all repos unless overridden locally

Examples

Example 1: Work and Personal Projects

Saved Configs:
1. "Work" - work-key
   User: John Doe
   Email: john.doe@company.com

2. "Personal" - personal-key
   User: John
   Email: john@personal.com

Switch between them when working on different projects!

Example 2: Multiple Clients

Saved Configs:
1. "Client A" - client-a
   User: John Doe
   Email: john@clienta.com

2. "Client B" - client-b
   User: John Doe
   Email: john@clientb.com

3. "Open Source" - oss
   User: johndoe
   Email: johndoe@users.noreply.github.com

Storage

  • Configurations are stored in VS Code's globalState
  • Available across all workspaces
  • Persists across VS Code restarts
  • Never stores your git credentials (only username and email)

Requirements

  • VS Code 1.85.0 or higher
  • Git installed and in PATH
  • A workspace with a git repository (for switching configs)

Known Limitations

  • Only manages user.name and user.email
  • Doesn't manage other git configs (signing, aliases, etc.)
  • Requires workspace to be a git repository for most operations
  • Tree view doesn't show configs if extension is not activated

Tips

  1. Use Local Scope: Always prefer local scope unless you want to change your global git config
  2. Descriptive Names: Use clear names like "Work - Acme Corp" instead of just "Work"
  3. Email Validation: The extension validates email format to prevent typos
  4. Quick Access: Pin the GitSmash sidebar for fastest access
  5. Status Bar: Quickly verify which config is active before committing

Troubleshooting

"Not a git repository" error

  • Ensure your workspace folder contains a .git directory
  • Open a folder that has been initialized with git init

Configs not appearing

  • Check if the extension is activated (look for status bar item)
  • Try refreshing the tree view with the refresh button

Git not found

  • Ensure git is installed on your system
  • Add git to your system PATH
  • Restart VS Code after installing git

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

License

MIT License - See LICENSE file for details

Changelog

Version 0.1.0

  • Initial release
  • Add, edit, delete git configurations
  • Switch between configs (local/global scope)
  • Status bar indicator
  • Tree view sidebar
  • Current config detection

Support

If you encounter any issues or have feature requests, please file an issue on the GitHub repository.


Made with ❤️ for developers who juggle multiple git identities

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