Switch between work, personal, and client personas with automatic gitconfig management and visual shell prompt feedback.
Why git-persona?
Managing multiple Git identities is a common challenge. Whether you're switching between work and personal projects, consulting for multiple clients, or contributing to open source under different emails, manually editing your gitconfig is tedious and error-prone.
git-persona makes identity management automatic. Define your personas once, then apply them to directories. Your commits will always use the right name, email, SSH key, and GPG signature without any manual intervention.
Named Personas
Create distinct identities for work, personal, clients, or open source. Each with its own name, email, and signing keys.
Directory-Based Switching
Apply personas to directories using Git's includeIf. All repos under that path automatically use the right identity.
Visual Prompt Feedback
See your active persona in your shell prompt with customizable colors. Never commit as the wrong person again.
SSH & GPG Support
Configure per-persona SSH keys and GPG signing. Your commits are signed with the correct key automatically.
Install
Install from source using Cargo:
cargo install --git https://github.com/uRadical/git-persona-cli
Or download a pre-built binary from the releases page.
Shell Integration
Add to your shell config for prompt integration:
# bash (~/.bashrc)
eval "$(git-persona init bash)"
# zsh (~/.zshrc)
eval "$(git-persona init zsh)"
# fish (~/.config/fish/config.fish)
git-persona init fish | source
Quick Start
Commands
addCreate a new personalistShow all personaseditModify a personarmDelete a personaapplyLink persona to directoryunapplyRemove directory linkstatusShow active personawhichShow full Git configinitSetup shell integrationGit Subcommand
git-persona integrates as a Git subcommand, so you can also use it as:
git persona add work --name "Jane Doe" --email "jane@company.com"
git persona apply work
git persona status
Configuration
Personas are stored in ~/.config/git-persona/config.json (respects XDG_CONFIG_HOME). The tool automatically manages your ~/.gitconfig with includeIf directives for directory-based switching.
Shell Completions
Generate completions for your shell:
git-persona completions bash > ~/.local/share/bash-completion/completions/git-persona
git-persona completions zsh > ~/.zfunc/_git-persona
git-persona completions fish > ~/.config/fish/completions/git-persona.fish
Learn More
For full documentation, see the GitHub repository.