Configured Git Profile
Comprehensive setting designed for display, current, model, directory. Includes structured workflows, validation checks, and reusable patterns for statusline.
Configured Git Profile
Statusline setting that displays your active git user profile, branch, and commit identity for multi-account workflows.
When to Use This Setting
Apply this setting when you need to:
- Verify which git identity (name and email) is active before committing in multi-account environments
- Display the current branch, remote origin, and configured signing key status in your statusline
- Prevent accidental commits under the wrong git profile when switching between personal and work repos Consider alternatives when:
- You only use a single git identity across all repositories
- Your statusline is already crowded and you need to minimize displayed information
Quick Start
Configuration
name: configured-git-profile type: setting category: statusline
Example Application
claude setting:apply configured-git-profile
Example Output
Setting applied. Changes:
- statusLine.type: command
- statusLine.command: bash git-profile-display
- display_fields: user.name, user.email, branch, remote
- signing_indicator: GPG key status icon
- scope_detection: local config overrides global
Core Concepts
Git Profile Display Overview
| Aspect | Details |
|---|---|
| Identity Fields | Reads user.name and user.email from git config with local-over-global precedence |
| Branch Display | Shows current HEAD branch name from git symbolic-ref or detached HEAD hash |
| Remote Tracking | Displays the configured origin remote URL for repository context |
| Signing Status | Indicates whether GPG or SSH commit signing is configured and active |
| Config Scope | Detects whether identity comes from local (.git/config) or global (~/.gitconfig) |
Git Profile Resolution Architecture
+--------------------+ +---------------------+ +------------------+
| Local Git Config |---->| Identity Resolver |---->| Signing Checker |
| .git/config | | local overrides | | gpg/ssh key? |
+--------------------+ | global fallback | +------------------+
| +---------------------+ |
v | v
+--------------------+ v +-----------------+
| Global Git Config | +------------------+ | Status Assembler|
| ~/.gitconfig | | Branch + Remote |---->| name+email+sign |
+--------------------+ | symbolic-ref | +-----------------+
+------------------+
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| show_email | boolean | true | Include user.email in the statusline identity display |
| show_remote | boolean | true | Display the origin remote URL alongside branch name |
| show_signing | boolean | true | Show GPG or SSH signing key status indicator icon |
| truncate_email | integer | 20 | Maximum characters to display for email before truncating |
| scope_indicator | boolean | false | Show whether identity originates from local or global config |
Best Practices
- Set local git config per repository - Run
git config --local user.name "Work Name"andgit config --local user.email "[email protected]"in each work repository so the statusline clearly distinguishes your work identity from your personal one without relying on global conditionalIncludes. - Enable scope indicator for debugging - Turn on the scope_indicator parameter when you suspect your commits are using the wrong identity. The local versus global label tells you immediately whether a project-specific override is active or missing.
- Truncate long email addresses - Corporate email addresses can be lengthy. Set truncate_email to 25 or fewer characters so the statusline remains readable on standard 80-column terminal widths without wrapping or pushing other fields off screen.
- Combine with GPG verification reminders - If your organization requires signed commits, the signing status indicator serves as a constant reminder. When the indicator shows unsigned, you know to run
git config --local commit.gpgsign truebefore committing. - Use with conditional git includes - Git supports
includeIfdirectives that switch config based on directory paths. The statusline will reflect whichever identity these conditional includes resolve to, giving you a live confirmation that your gitconfig rules are working correctly.
Common Issues
- Email shows global instead of local - You have not set a local user.email in this repository. Run
git config --local user.email "[email protected]"to create a repo-specific override that the statusline will detect and display. - Branch shows HEAD detached - You are in detached HEAD state, typically from checking out a specific commit hash or tag. The statusline correctly reflects this state. Check out a named branch with
git checkout mainto restore normal branch display. - Signing indicator shows inactive - No GPG or SSH signing key is configured for this git identity. Run
git config --local user.signingkey YOUR_KEY_IDandgit config --local commit.gpgsign trueto enable commit signing and update the statusline indicator.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Project Standards Config
Claude Code settings preset that enforces consistent coding standards. Configures TypeScript strict mode, ESLint rules, Prettier formatting, and naming conventions.
Bedrock Configuration Blueprint
All-in-one setting covering configure, claude, code, amazon. Includes structured workflows, validation checks, and reusable patterns for api.
Refined Corporate Preset
Production-ready setting that handles configure, proxy, settings, corporate. Includes structured workflows, validation checks, and reusable patterns for api.