Git SSH Manager is a simple command-line utility that helps you manage multiple Git SSH profiles with ease. It allows you to create, switch, and remove SSH keys and Git global user configurations (username and email) using straightforward commands.
The Story Behind
git-ssh-managerMy Journey Building My First CLI Tool
- Quickly generate new SSH keys and Git profiles
- Seamlessly switch between profiles for different projects
- View the current profile and its public key
- Remove profiles you no longer need
- ✅ Linux
- ✅ macOS
- ✅ Windows
Linux/MacOS
Note: git-ssh-manager requires Go version 1.24.2 or higher if building from source.
-
Clone the repository:
$ git clone https://github.com/mhbidhan/git-ssh-manager.git $ cd git-ssh-manager -
Build and install:
make install
- Download the latest precompiled binary: 👉 Download from Google Drive
-
Unzip the archive (this shows the file structure):
files ├── gsm └── install.sh -
Run the install script:
$ chmod +x install.sh $ ./install.sh
Windows
Note: git-ssh-manager requires Go version 1.24.2 or higher if building from source.
-
Clone the repository:
$ git clone https://github.com/mhbidhan/git-ssh-manager.git $ cd git-ssh-manager -
Build and install:
git-ssh-manager └── src └── build_utils └── install.bat - Run the install.bat as an Administrator
- Download the latest precompiled binary: 👉 Download from Google Drive
-
Unzip the archive (this shows the file structure):
/files ├── gsm └── install.bat └── update_path.bat - Run the install.bat as an Administrator
Note: The program might not work on Windows correctly. If it doesn't produce expected results, manually add C:\Program Files\GitSSHManager to your Windows environment paths. Windows sometimes fails to update this automatically.
After installation, check that it works:
$ gsm -hExpected output:
-gk, --get-key prints the public key
-l, --list outputs a list of all available profiles
-s, --status outputs the active profile
-n, --new create new profile
-u, --use use to profile
-r, --remove remove profile
-h, --help list all command
To use git-ssh-manager, simply run the following command:
# gsm --(COMMAND)
$ gsm -s
# or
$ gsm --statusBelow are the supported commands:
| Command | Description |
|---|---|
-gk, --get-key |
Prints the public key of the current profile. |
-l, --list |
Displays a list of all available profiles. |
-s, --status |
Displays the currently active profile. |
-n, --new |
Creates a new profile. |
-u, --use |
Switches to the specified profile. |
-r, --remove |
Removes an existing profile. |
-h, --help |
Lists all available commands and their descriptions. |
# Create a new profile
$ gsm -n profile-name # Promts for username and email
# Switch to a profile
$ gsm -u work
# View current active profile
$ gsm -s
# Get the public key of the profile
$ gsm -gk profile-name
# Remove a profile
$ gsm -r work # Works for non-active profilesPrompts for username and email to create a new SSH profile.
The username and email should match your GitHub (or other remote Git service) identity.
$ gsm -n workUsername: work_user Email: user@work.com
Activates the specified SSH profile and updates the global Git username and email.
$ gsm -u work$ git config --list
user.name=work_user
user.email=user@work.comPrints the public key of the specified profile.
You can copy and add this to your GitHub or other Git host.
gsm -gk workssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFK... user@work.com