- Overview
- What It Automates
- Account Modes
- Features
- Installation
- Quick Start
- Commands
- Advanced Features
- Contributing
- License
As a user of multiple git accounts, I needed to switch regularly between my student, professional, and personal profiles. Manually updating configs, loading SSH keys, and keeping track of identities quickly became tedious.
So I built this open source CLI tool to streamline the whole process.
GitUser helps you switch between different git accounts effortlessly. It automates all the necessary configuration commands: username, email, GPG signing, SSH key loading, so you can focus on coding instead of fiddling with your setup.
Whether you're pushing to school projects, personal repos, or work-related codebases, GitUser makes sure you're always using the right identity with a single command.
Instead of manually running these commands every time you switch projects:
git config --global user.name "yourUsername"
git config --global user.email "yourEmail"
git config --global user.signingkey "yourSigningKeyID"
git config --global commit.gpgsign true
ssh-add ~/.ssh/your_ssh_key
Just run gituser work
β¨
There is currently 3 modes available:
- π» work : for a work related git account.
- π school : for a school related git account.
- π personal : for a personal related git account.
- π Instant Account Switching - Switch between work, school, and personal accounts
- π§ Complete Git Configuration - Manages username, email, and GPG signing
- ποΈ SSH Key Management - Automatically loads the correct SSH key for each account
- π― Interactive Setup - Guided wizard to configure all your accounts
- π‘οΈ Secure - Each account uses its own SSH key for isolation
- π Zero Configuration After Setup - One command switches everything
brew tap lucasnevespereira/homebrew-tools
brew install --cask gituser
or
brew install --cask lucasnevespereira/homebrew-tools/gituser
Make sur your bin path is in your $PATH
, you can check in your .zshrc
or .bash
file.
e.g
export PATH="$HOME/bin:$PATH"
Run the following command from the root of the project:
make install
This will build gituser and move it to your $HOME/bin
Setup your accounts:
gituser setup
Switch between accounts:
gituser work # Switch to work account
gituser personal # Switch to personal account
gituser school # Switch to school account
Check current account:
gituser now
Command | Description |
---|---|
Account Management | |
gituser setup |
Interactive setup for all accounts (username, email, GPG, SSH) |
gituser work |
Switch to work account |
gituser personal |
Switch to personal account |
gituser school |
Switch to school account |
Information | |
gituser now |
Show current active account |
gituser info |
Display all configured accounts |
SSH Management | |
gituser ssh list |
List SSH keys currently loaded |
gituser ssh discover |
Find existing SSH keys on your system |
gituser ssh test |
Test SSH connections to GitHub/GitLab |
gituser ssh guide |
Show SSH setup guide |
Help | |
gituser help |
Show help information |
gituser manual |
Show detailed manual |
gituser quickstart |
Show quick start guide |
GitUser automatically handles SSH keys for each account:
- Auto-discovery - Finds existing SSH keys on your system
- Key generation - Helps create new SSH keys during setup
- Automatic switching - Loads the correct SSH key when switching accounts
- Connection testing - Verifies SSH setup works with GitHub/GitLab
Configure different GPG keys for each account to enable signed commits with proper identity verification.
If you want to contribute to this project please read the Contribution Guide.
This project is under MIT LICENSE