Skip to content

lucasnevespereira/go-gituser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
logo

Switch between git accounts easily

Latest Release Build Status Stars Forks Issues Contributors Sponsor MIT License

Table of Contents

Overview

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.

demo

What It Automates

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 ✨

Account Modes

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.

Features

  • πŸ”„ 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

Installation

Homebrew (Recommended)

brew tap lucasnevespereira/homebrew-tools
brew install --cask gituser

or

brew install --cask lucasnevespereira/homebrew-tools/gituser

Manual Installation

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

Quick Start

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

Commands

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

Advanced Features

SSH Key Management

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

GPG Signing

Configure different GPG keys for each account to enable signed commits with proper identity verification.

Contributing

If you want to contribute to this project please read the Contribution Guide.


License

This project is under MIT LICENSE


⭐ If GitUser helps you, please consider giving it a star!