← All Tools

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

git-persona
# Create a work persona
git-persona add work --name "Jane Doe" --email "jane@company.com"
 
# Create a personal persona
git-persona add personal --name "Jane" --email "jane@gmail.com"
 
# Apply work persona to work directory
cd ~/work
git-persona apply work
 
# Check current persona
git-persona status

Commands

git-persona commands
addCreate a new persona
listShow all personas
editModify a persona
rmDelete a persona
applyLink persona to directory
unapplyRemove directory link
statusShow active persona
whichShow full Git config
initSetup shell integration

Git 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:

bash zsh fish
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.