Git Identity Manager (gitid)
A terminal-based tool that helps developers manage multiple Git identities easily through an interactive interface.
Features
- 🔄 Switch between multiple Git identities globally
- 📁 Set repository-specific local identities
- 🏷️ Optional nicknames for quick identity identification
- ➕ Add new identities interactively
- 🗑️ Delete unwanted identities
- 💻 Terminal-based UI with keyboard navigation
- 🔒 Uses Git's built-in configuration system
- 🔍 Smart identity matching by nickname, name, or email
- 📋 Command-line interface for automation and scripting
- ✨ Visual indicators for current global and local identities
Installation
From Binary
Download the appropriate binary for your platform from the releases page.
From Package (Linux)
Debian/Ubuntu:
RedHat/Fedora:
Arch Linux (AUR):
# Pre-compiled binary yay -S gitid-bin # Build from source yay -S gitid-git
Building from Source
Prerequisites
- Go 1.21 or later
- Make
- NFPM (for package generation)
Build Commands
# Build for your current platform make build # Build static binary (Linux only) make build-static # Create releases for all platforms and packages make release # Clean build artifacts make clean
Usage
GitID provides both an interactive TUI and command-line interface for managing Git identities.
Interactive Mode
Run gitid (without arguments) to start the interactive interface.
Keyboard Controls
↑/↓orj/k- Navigate through identitiesEnter- Select identity to set as globalr- Set selected identity as local for current repositoryR- Remove local identity (use global)D- Delete selected identitye- Edit nickname for selected identityE- Edit full identity (name, email, nickname)←/→- Navigate confirmation dialogEsc- Cancel current actionq- Quit application
Command Line Interface
GitID also provides a full CLI for automation and scripting:
Global Identity Management
# List all identities gitid list # Show current global (and local if in repo) identity gitid current # Switch global identity gitid switch <nickname|name|email> gitid use <nickname|name|email> # Alias for switch # Add new identity gitid add "Full Name" "email@domain.com" [nickname] # Delete identity gitid delete <nickname|name|email> # Set/update nickname gitid nickname <identifier> <new-nickname>
Repository-Specific (Local) Identity Management
# Show current local identity for repository gitid repo current # Set existing identity as local for current repository gitid repo use <nickname|name|email> # Add new identity and set as local for current repository gitid repo add "Full Name" "email@domain.com" [nickname]
Global vs Local Identities
GitID supports both global and local (repository-specific) Git identities:
Global Identity
- Applied to all Git repositories by default
- Stored in Git's global configuration (
~/.gitconfig) - Set with
gitid switch <identifier>or by pressingEnterin TUI
Local Identity
- Applied only to the current repository
- Stored in the repository's local
.git/config - Overrides global identity for that specific repository
- Set with
gitid repo use <identifier>or by pressingrin TUI
Visual Indicators
- TUI: Shows repository status and
[local]indicators - CLI:
gitid currentshows both global and local when in a repository - CLI:
gitid listshows[current local]indicator
Managing Identities
In TUI (Interactive Mode)
- Switch Global Identity: Select an identity and press
Enter - Set Local Identity: Select an identity and press
r(only in git repositories) - Remove Local Identity: Press
Rto fall back to global identity - Add Identity: Select "Add new identity" and follow the prompts
- Edit Identity: Press
efor nickname orEfor full identity - Delete Identity: Navigate to an identity and press
D, then confirm
Via Command Line
- Global: Use
gitid switch/use/add/deletecommands - Local: Use
gitid repo use/add/currentcommands
Example Workflow
# Add work identity gitid add "John Doe" "john.doe@company.com" work # Add personal identity gitid add "John Doe" "john@personal.com" personal # Set global identity to personal gitid switch personal # In work repository, set local identity to work cd ~/work-project gitid repo use work # Check current status gitid current # Output: # Global: personal (John Doe <john@personal.com>) # Local: work (John Doe <john.doe@company.com>)
Shell Completions
GitID supports shell completions for Bash, Zsh, and Fish to provide tab-completion for commands and arguments.
Installation
# Install for your current shell (auto-detected) gitid completion bash # For Bash gitid completion zsh # For Zsh gitid completion fish # For Fish
Upgrade
# Upgrade completions (remove and reinstall) gitid completion upgrade # Auto-detect current shell gitid completion upgrade bash # Upgrade for specific shell
Removal
# Remove completions gitid completion bash -r # Remove Bash completions gitid completion zsh -r # Remove Zsh completions gitid completion fish -r # Remove Fish completions
After installation, restart your shell or source your configuration file (e.g., source ~/.bashrc or source ~/.zshrc).
Nicknames
Nicknames are optional short identifiers that make it easier to distinguish between identities:
- Display: Identities with nicknames show as
nickname (Name <email>) - Without nicknames: Shows as
Name <email>(backwards compatible) - Adding nicknames: Available when creating new identities or editing existing ones
- Smart matching: CLI supports switching by nickname, name, or email
- Quick identification: Especially useful when you have multiple identities with similar names
Help and Documentation
# Show help and all available commands gitid help # Get command-specific usage gitid repo # Shows repo subcommand usage gitid completion # Shows completion installation usage
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
