Manage multiple Git identities with ease. Switch between work, personal, and client personas with automatic gitconfig management and visual prompt feedback.
- 🎭 Multiple named personas with different Git identities
- 🔑 Per-persona SSH keys and GPG signing
- 🎨 Colored shell prompt showing active persona
- 📁 Apply personas to directories with automatic
includeIfmanagement - 🐚 Shell completion for bash, zsh, and fish
Download the latest release for your platform from the releases page.
cargo install --git https://github.com/uRadical/git-personaAdd to your shell config:
# Bash (~/.bashrc)
eval "$(git-persona init bash)"
# Zsh (~/.zshrc)
eval "$(git-persona init zsh)"
# Fish (~/.config/fish/config.fish)
git-persona init fish | source# Interactive
git-persona add
# Non-interactive
git-persona add work -n "Alan" -e "alan@company.com" -c blue
git-persona add personal -n "Alan" -e "alan@home.com" -c green -k ~/.ssh/personalcd ~/code/work-project
git-persona apply work
# ✓ Created ~/code/work-project/.gitconfig
# ✓ Updated ~/.gitconfig (backup: ~/.gitconfig.bak)This creates a local .gitconfig and adds the appropriate includeIf to your global config.
git-persona list
# personal (green)
# * work (blue) ← current
git-persona list --all
# work (blue)
# ~/code/work-project
# ~/code/client-a
#
# personal (green)
# ~/code/ossgit-persona status
# work
git-persona which
# Persona
# Name: work
# Color: blue
#
# Git Config
# user.name: Alan
# user.email: alan@company.com
# core.sshCommand: ssh -i ~/.ssh/work -o IdentitiesOnly=yesWith shell integration, your prompt shows the active persona in its assigned color:
~/code/work-project [work]$ ← blue
~/code/personal [personal]$ ← green
~/tmp$ ← no tag
# Remove from current directory
git-persona unapply
# Delete a persona (blocked if in use)
git-persona rm work
# Error: persona 'work' is in use at 2 location(s)
# Force delete (removes from all locations)
git-persona rm work --forcegit-persona edit work
# Interactive prompts to modify fieldsSince the binary is named git-persona, Git automatically recognizes it as a subcommand:
git persona list
git persona apply work
git persona statusConfig is stored at ~/.config/git-persona/config.json (respects XDG_CONFIG_HOME).
black, red, green, yellow, blue, magenta, cyan, white
Bright variants: bright-red, bright-green, etc.
This project supersedes gitorgs, rewritten in Rust for improved performance and reliability.
MIT