When it appears
It renders inside a Git repository when at least one configured status value has content.
Preview
Rendered from the starting configuration in a representative simulated environment.
starship — preview
$!+?⇡
Starting configuration
[git_status]
format = "([$all_status$ahead_behind]($style) )"
style = "bold yellow"Open in the builderThe configuration is compressed into the URL fragment and stays in your browser.
Key options
- formatstring
- The default format for git_status
- stylestring
- The style for the module.
- stashedstring
- The format shown when a stash exists for the local repository.
- modifiedstring
- The format shown when there are file modifications in the working directory.
- stagedstring
- The format shown when a new file has been added to the staging area.
- untrackedstring
- The format shown when there are untracked files in the working directory.
- aheadstring
- The format shown when this branch is ahead of the branch being tracked.
- behindstring
- The format shown when this branch is behind the branch being tracked.
- divergedstring
- The format shown when this branch has diverged from the branch being tracked.
Format variables
- $all_status
- Shortcut for $conflicted$stashed$deleted$renamed$modified$typechanged$staged$untracked.
- $ahead_behind
- Displays diverged, ahead, behind or up_to_date format string based on the current status of the repo.
- $stashed
- Displays stashed when a stash exists for the local repository.
- $modified
- Displays modified when there are file modifications in the working directory.
- $staged
- Displays staged when a new file has been added to the staging area.
- $untracked
- Displays untracked when there are untracked files in the working directory.
- $conflicted
- Displays conflicted when this branch has merge conflicts.
Common adjustments
- Keep $all_status and $ahead_behind if you want Starship's compact aggregate output.
- Place individual status variables in conditional groups when each needs a different label.
- Set ignore_submodules when submodule dirtiness is too expensive or distracting.