Starship Git Status & Branch Display
Intermediatev1.0.0
Configure Starship's git modules for rich repository status display — branch names, ahead/behind counts, modified/staged indicators, and stash counts with custom symbols.
Content
Overview
Git status in your prompt is the single most useful piece of contextual information for developers. Starship's git modules show branch name, modification status, ahead/behind counts, and more — all updated in real-time as you work.
Why This Matters
- -Instant awareness — see uncommitted changes without running git status
- -Branch safety — always know which branch you're on
- -Sync status — see if you need to push/pull
- -Stash reminder — don't forget stashed changes
How It Works
Step 1: Configure git_branch
Step 2: Configure git_status
Step 3: Configure git_commit & git_state
Reading the Prompt
Performance Optimization
Best Practices
- -Always show git_branch — most essential module
- -Use counts in git_status —
!${count}not just! - -Set truncation for long branch names (30 chars max)
- -Show git_state for rebase/merge/cherry-pick awareness
- -Test in large repos — ensure prompt stays fast
Common Mistakes
- -Disabling git_status (losing the most useful information)
- -Not using count variables (can't tell 1 vs 100 modified files)
- -No truncation on branch names (feat/very-long-branch-name-overflows)
- -Ignoring git_state (confused during rebase operations)
FAQ
Discussion
Loading comments...