CLI Tool Completed
G

GitIdentitree

A powerful CLI tool to manage multiple Git identities and automatically switch between them based on directory context using Git's native includeIf mechanism.

Overview

GitIdentitree is a command-line interface tool designed for developers who need to maintain multiple Git identities across different contexts. Whether you’re managing work, personal, and open-source projects, GitIdentitree automates the process of switching between Git profiles based on your current directory.

Key Features

Multiple Profiles Management

  • Create unlimited Git profiles for different contexts (work, personal, open-source, etc.)
  • Custom author names separate from profile names
  • Support for GPG signing keys per profile

Automatic Context Switching

  • Profiles activate automatically based on directory context
  • Uses Git’s native includeIf mechanism for seamless integration
  • No background processes or constant monitoring required

SSH Key Integration

  • Integrated SSH key loading and unloading per profile
  • Auto-activate feature for shell integration
  • Shell completion support for bash, zsh, fish, and PowerShell

Beautiful Interactive UI

  • Terminal User Interface (TUI) powered by Bubble Tea and Huh
  • Intuitive profile creation and management
  • Visual status overview of all mappings

Safe Operations

  • Prevents accidental deletion of mapped profiles
  • Auto-unmap option when deleting profiles
  • Path normalization with ~ expansion
  • Comprehensive error handling

Technology Stack

Installation

Available for macOS, Linux, and Windows. Install via pre-built binaries or build from source:

# macOS (Apple Silicon)
curl -L https://github.com/thuanlegit/git-identitree/releases/latest/download/gidtree-darwin-arm64 -o gidtree
chmod +x gidtree
sudo mv gidtree /usr/local/bin/

Quick Start

# Initialize Git Identitree
gidtree init

# Create your first profile
gidtree profile create

# Map profile to directory
gidtree map work ~/projects/work

# Verify it works
cd ~/projects/work
git config user.email  # Shows your work email

Use Cases

  • Freelancers: Manage identities for different clients
  • Open Source Maintainers: Separate personal and project contributions
  • Enterprise Developers: Switch between work and personal projects
  • Multi-language Contributors: Use different names/emails for different communities