Prompt segments

Understand the Git status segment rendered by gitflect.

The default prompt segment is compact and intentionally close to posh-git style.

[main ≡ +1 ~2 -0 !]

Branch and upstream

The first field is the branch or detached HEAD description.

ExampleMeaning
mainCurrent branch
HEADDetached HEAD when no better description is available
v1.2.0Detached HEAD described by a tag when available

Upstream state is shown next when the branch has tracking information.

SymbolMeaning
Local branch and upstream are even
↑2Local branch is ahead by two commits
↓1Local branch is behind by one commit
↓1 ↑2Local branch has diverged
goneThe configured upstream no longer exists

File counts

The segment separates staged changes from working tree changes with | when both are present.

[main ≡ +1 ~0 -0 | +1 ~2 -1 !]
PartMeaning
First + ~ - groupStaged additions, modifications, deletions
Second + ~ - groupWorking tree additions, modifications, deletions
!Untracked files are present
!3Merge conflicts are present
$2Two stash entries are present when stash status is enabled

Zero counts can be hidden or shown with configuration.

In-progress operations

When Git is in the middle of an operation, gitflect annotates the branch name.

[main|MERGING ≡ !1]

Supported operation indicators include merge, rebase, cherry-pick, revert, and bisect state.

Status-only rendering

Use status-only mode when a shell integration needs just the Git segment.

gitflect prompt --status-only --no-color

Use full prompt mode when gitflect should render the path, status, and prompt suffix.

gitflect prompt --shell bash