A simple and efficient command-line tool to manage multiple Git profiles. Switch between different Git user profiles (work, personal, etc.) with a single command.
- 🔄 Switch between multiple Git profiles quickly
- 🔒 Secure storage of Git credentials
- 📋 List all configured profiles
- ✏️ Update existing profiles
- ❌ Remove unused profiles
- 🛠️ Easy to install and use
- 🚀 Built with Rust for performance and reliability
You can install git-thing in one of two ways: download the prebuilt binary, or build from source.
Download the released binary and place it in /usr/bin so it's available system-wide:
# download the binary (use the raw file URL)
curl -L -o git-thing https://raw.githubusercontent.com/Goitseone-Themba/git-thing/master/git-thing
# make it executable
chmod +x git-thing
# move to /usr/bin (requires sudo)
sudo mv git-thing /usr/bin/git-thing
# (optional) ensure ownership and permissions
sudo chown root:root /usr/bin/git-thing
sudo chmod 755 /usr/bin/git-thingAfter this the git-thing command will be available from your shell. (If you prefer a user-scoped location, move the binary into ~/bin or $HOME/.local/bin instead.)
- Rust (latest stable version recommended)
- Git (obviously!)
- A GitHub personal access token (recommended: classic token with only full repo access) — see: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic
-
Clone the repository:
git clone https://github.com/Goitseone-Themba/git-thing.git cd git-thing -
Build and install:
cargo install --path .This will install the
git-thingbinary to your Cargo bin directory (usually~/.cargo/bin/). -
(Optional) Add the Cargo bin directory to your PATH if it's not already:
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc source ~/.bashrc # or ~/.zshrc
git-thing add \
--profilename work \
--username work-username \
--email work@example.com \
--personal-access-key your-github-tokenOr using short flags:
git-thing add -p work -u work-username -e work@example.com -k your-github-tokengit-thing listgit-thing switch --profile workOr using short flag:
git-thing switch -p workUpdate any field of an existing profile. Only the fields you specify will be updated.
# Update just the email
git-thing update --profilename work --email new.email@example.com
# Update multiple fields
git-thing update -p work -u newusername -k newtoken123Remove a profile that you no longer need:
git-thing delete --profilename oldprofileOr using short flag:
git-thing delete -p oldprofile- Profiles are stored in
~/.config/git-thing/config.json - Switching profiles updates:
- Global Git username and email
- Git credentials file (
~/.git-credentials)
- The config file is updated when you add, update, or delete profiles
- The config file has standard user permissions (600)
- Personal access tokens are stored in plain text in the config file
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with clap for command-line parsing
- Inspired by the need for simpler Git profile management