C

Configured Git Profile

Comprehensive setting designed for display, current, model, directory. Includes structured workflows, validation checks, and reusable patterns for statusline.

SettingClipticsstatuslinev1.0.0MIT
0 views0 copies

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

AspectDetails
Identity FieldsReads user.name and user.email from git config with local-over-global precedence
Branch DisplayShows current HEAD branch name from git symbolic-ref or detached HEAD hash
Remote TrackingDisplays the configured origin remote URL for repository context
Signing StatusIndicates whether GPG or SSH commit signing is configured and active
Config ScopeDetects 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

ParameterTypeDefaultDescription
show_emailbooleantrueInclude user.email in the statusline identity display
show_remotebooleantrueDisplay the origin remote URL alongside branch name
show_signingbooleantrueShow GPG or SSH signing key status indicator icon
truncate_emailinteger20Maximum characters to display for email before truncating
scope_indicatorbooleanfalseShow whether identity originates from local or global config

Best Practices

  1. Set local git config per repository - Run git config --local user.name "Work Name" and git 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.
  2. 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.
  3. 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.
  4. 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 true before committing.
  5. Use with conditional git includes - Git supports includeIf directives 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

  1. 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.
  2. 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 main to restore normal branch display.
  3. Signing indicator shows inactive - No GPG or SSH signing key is configured for this git identity. Run git config --local user.signingkey YOUR_KEY_ID and git config --local commit.gpgsign true to enable commit signing and update the statusline indicator.
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates