GitHub SSH Profile Switcher
Use the right GitHub account in every VS Code workspace.
GitHub SSH Profile Switcher helps you switch between personal, work, client, and
organization Git identities without manually editing Git config or SSH commands
for every repository.
Who This Is For
Use this extension if you:
- use multiple GitHub accounts on the same machine
- have separate SSH keys for work, personal, or client repositories
- push to different GitHub organizations from VS Code
- need different Git
user.name and user.email per repository
- want one place to manage SSH keys, Git remotes, and identity switching
What The Extension Does
The extension can manage:
- Git username
- Git email
- SSH private key
- GitHub SSH host alias
- GPG signing key
- commit signing setting
- initialized submodules
- GitHub remote URLs
Profiles are created once and can be selected from any repository.
Install
- Open VS Code.
- Open Extensions.
- Search for
GitHub SSH Profile Switcher.
- Install the extension from
TigerDev1991.
- Open a Git repository.
- Run
SSH Profiles: Open Manager.
Quick Start
Click Setup Identity in the VS Code status bar, or run:
SSH Profiles: Open Manager
Click Create Profile.
Enter your Git name, email, SSH key path, and host alias.
Click Save Changes or Create Profile.
Click Apply on the profile card.
If your remote is HTTPS, click HTTPS -> SSH in the Git Remotes block.
Push normally.
Profile Examples
Typical profile names:
Personal
Work
Client
Company GitHub
Open Source
Example Personal profile:
Name: Personal
Git user.name: Alex Personal
Git user.email: alex.personal@example.com
SSH Key: ~/.ssh/id_ed25519
SSH Host: github.com-personal
Example Work profile:
Name: Work
Git user.name: Alex Developer
Git user.email: alex.developer@company.example
SSH Key: ~/.ssh/id_ed25519_github_work
SSH Host: github.com-work
SSH Config
For host aliases to work, the extension writes matching entries to
~/.ssh/config automatically when you generate a key or when you create, save,
or apply a profile.
Example:
# GitHub SSH Profile Switcher: begin github.com-personal
Host github.com-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
# GitHub SSH Profile Switcher: end github.com-personal
# GitHub SSH Profile Switcher: begin github.com-work
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_github_work
IdentitiesOnly yes
# GitHub SSH Profile Switcher: end github.com-work
The profile SSH Host value should match the Host value.
If ~/.ssh/config already contains a manual Host entry with the same alias,
the extension leaves that entry unchanged and shows a warning instead of
overwriting your custom SSH config.
Manager Screen
The manager shows:
- saved Git identity profiles
- current workspace status
- Git remotes
- detected SSH keys
- active profile
- recommended profile
- current Git user
- current
core.sshCommand
Use the profile card buttons:
Apply: use this profile in the current workspace
Edit: update the profile
Test: test GitHub SSH login
Delete: remove the profile from the manager
Global Profiles
Profiles are global. You do not need to create the same profile in every
repository.
Create the profile once, then:
- Open another repository.
- Open the manager.
- Select or apply the related profile.
The active profile is still workspace-specific, so each repository can use a
different identity.
Safe Storage
Profiles created in the manager are stored in VS Code private extension storage.
They are not written to .vscode/settings.json.
This helps prevent personal identity data from being committed to GitHub.
If you used an older version that wrote profiles into .vscode/settings.json,
the extension imports those profiles into the global list when you open that
workspace.
HTTPS To SSH
If GitHub push fails with an error like:
HTTP 403
your remote is probably still HTTPS.
In the manager:
- Find the
Git Remotes block.
- Look for an
HTTPS badge.
- Click
HTTPS -> SSH.
Example conversion:
https://github.com/company-org/app.git
becomes:
git@github.com-work:company-org/app.git
SSH Keys
The SSH Keys block detects private keys in ~/.ssh.
You can:
- generate a new SSH key
- open SSH config
- see which profiles use a key
- delete a detected key
Deleting a key requires confirmation. The extension deletes the private key and
the matching .pub file if it exists.
Generate SSH Key
Use Generate Key when you need a new SSH key for a GitHub account.
The extension can:
- create an
ed25519 or rsa key
- create the
.pub file
- write the matching OpenSSH
Host entry
- show the public key
- copy the public key
- create a profile from the new key
After generating a key, add the public key to GitHub:
GitHub -> Settings -> SSH and GPG keys -> New SSH key
Submodules
Enable Apply identity to initialized submodules when a repository contains
Git submodules.
When enabled, applying a profile also writes the same identity and SSH command
to initialized submodules.
GPG Signing
If your account uses signed commits, add:
- GPG signing key
- GPG format
- Sign commits toggle
When the profile is applied, the extension writes the signing settings to the
local Git repository.
Commands
Open the Command Palette and run:
SSH Profiles: Open Manager
SSH Profiles: Create Profile
SSH Profiles: Edit Profile
SSH Profiles: Delete Profile
SSH Profiles: Generate SSH Key
SSH Profiles: Select Profile
SSH Profiles: Switch to Next Profile
SSH Profiles: Apply Profile to Workspace
SSH Profiles: Test GitHub SSH Login
SSH Profiles: Rewrite Remote to Profile Host
SSH Profiles: Open SSH Config
SSH Profiles: Show Current Git Identity
Troubleshooting
Push uses the wrong GitHub account
Check that the workspace has the correct active profile. Then check that the
remote is SSH, not HTTPS.
Push returns HTTP 403
The remote is probably HTTPS. Use HTTPS -> SSH in the Git Remotes block.
SSH test works but push still fails
The SSH key is valid, but the Git remote may still be HTTPS or may use the
wrong host alias.
Profile is missing in another repo
Profiles created in the manager are global. If an old profile exists only in a
previous repo's .vscode/settings.json, open that repo once so the extension
can import it.
Key shows missing
The private key path in the profile does not exist on disk. Edit the profile and
choose the correct key path.
Optional Settings
Most users do not need to edit settings manually.
Useful options:
{
"sshProfileSwitcher.showRecommendationOnOpen": true,
"sshProfileSwitcher.autoApplyRecommendedProfile": false,
"sshProfileSwitcher.rewriteRemoteOnApply": false,
"sshProfileSwitcher.writeCoreSshCommand": true,
"sshProfileSwitcher.writeOpenSshConfig": true,
"sshProfileSwitcher.writeVsCodeGitSshCommand": false,
"sshProfileSwitcher.sshCommandExtraArgs": []
}
The extension uses Git core.sshCommand by default because it works from VS
Code Git and from the terminal.
writeOpenSshConfig is enabled by default. It only manages SSH config blocks
marked with GitHub SSH Profile Switcher comments and avoids overwriting
manual Host entries with the same alias. If a generated key would reuse a
host alias already assigned to another saved profile with a different key, the
extension shows a warning instead of changing that alias.
git.sshCommand is disabled by default because some VS Code environments reject
programmatic updates to that setting.
Support
Report bugs and request features here:
https://github.com/TigerDev-Studio/My-Tools-Issues/issues
When reporting an issue, include your VS Code version, extension version,
operating system, Git remote URL style, and the error message you see.
Privacy
The extension does not send SSH keys, profile data, Git remotes, or Git identity
data to an external service. It runs locally inside VS Code.