Options

Set variables in .zshrc. For example, to only show the user if not me, only show the host if not my-computer or my-other-computer, and use symbols to distinguish between branches and commits:

# ~/.zshrc
# --- snip ---
GIT_PROMPT_KIT_HIDDEN_HOSTS=( my-computer my-other-computer )
GIT_PROMPT_KIT_HIDDEN_USERS=( me )
GIT_PROMPT_KIT_SYMBOL_BRANCH="#"
GIT_PROMPT_KIT_SYMBOL_COMMIT="•"
# Load Git Prompt Kit (will differ depending on installation method)

To output your configuration, for example for sharing, run

git-prompt-kit-config

(The exporter makes an effort to get quoting right, but if you use a custom configuration with quotation marks it's worth double checking that the exported value is correct.)

Behavior options

OptionDefaultType Description
1integerHide dimmed symbols for the commits ahead of and commits behind the upstream branch when the count is zero? (HIDE if non-zero, SHOW if zero)
1integerHide dimmed Git stash, assumed-unchanged, and skip-worktree symbols when the count is zero? (HIDE if non-zero, SHOW if zero)
1integerDo not show the word "Git" before the Git ref info? (HIDE if non-zero, SHOW if zero)
1integerShow Git status symbols (dimmed) when the count is zero? (SHOW if non-zero, HIDE if zero)

Color options

Colors can be

Support varies by terminal emulator.

To visualize the configured colors, run

git-prompt-kit-colors

To print the configured values, run

git-prompt-kit-config

TIP

Colors may appear differently in your terminal. To check, it can be useful to run print -P %F{<color>}<text>%f, for example print -P %F{199}●%f or print -P %F{#34d5eb}●%f.

OptionDefaultType Swatch Description
199colorColor of the Git action segment
81colorColor of the Git assumed unchanged files segment
39colorColor of the current working directory segment
88colorColor of the prompt character when the previous command failed
140colorColor of the Git HEAD segment when the working tree is dirty
109colorColor of the host segment
247colorColor of inactive segments
111colorColor of the Git push remote and its commits-ahead files segment
216colorColor of the Git remote and its commits-ahead files segment
81colorColor of the Git skip-worktree files segment
120colorColor of Git staged files segment
81colorColor of the Git stashes segment
76colorColor of the prompt character when the previous command succeeded
86colorColor of Git tag segment
162colorColor of Git unstaged files segment
109colorColor of the user segment

Content options

To print the configured values, run

git-prompt-kit-config
OptionDefaultType Description
1integerThe maximum number of trailing path components in the GIT_PROMPT_KIT_CWD. Additional components will be ellided with .... If less than zero, show all
upstreamstringThe default Git push remote when distinct from the pull remote
originstringThe default Git remote
()arrayHosts which will not be included in the prompt
()arrayUsers which will not be included in the prompt
1integerThe maximum number of trailing path components in GIT_PROMPT_KIT_REPO_SUBDIRECTORY. Additional components will be ellided with .... If less than zero, show all
0integerSet to a non-empty string to enable the verbose default symbols

Symbol options

To print the configured values, run

git-prompt-kit-config

The default symbols should work well in any font.

The default Git file status symbols are based on Git's own short format (underscore _ represents empty columns in git-status --short's output). The alternate "verbose" set of default symbols take up more space, but their meaning may be clearer.

OptionDefault Verbose Default Type Description
+ahead stringPrecedes the Git commits-ahead segment
aheadFollows the Git assume-unchanged segment when inactive
assumed-unchangedstringFollows the Git assume-unchanged segment
assumed-unchangedFollows the Git assume-unchanged segment when inactive
-behind stringPrecedes the Git commits-behind segment
behindPrecedes the Git commits-behind segment when inactive
branch: stringPrecedes the Git branch
%%stringCharacter shown at end of prompt for normal users
#stringCharacter shown at end of prompt for root users
commit: stringPrecedes the Git commit
UU conflictedstringFollows the Git conflicted files segment
conflictedFollows the Git conflicted files segment when inactive
_D deletedstringFollows the Git unstaged deleted file segment
deletedFollows the Git unstaged deleted file segment when inactive
D_ staged-deletedstringFollows the Git staged deleted file segment
staged-deletedFollows the Git staged deleted file segment when inactive
@ host: stringPrecedes the host
localstringShown if the checked out branch has no upstream
_M modifiedstringFollows the Git unstaged modified file segment
modifiedFollows the Git unstaged modified file segment when inactive
M_ modified-stagedstringFollows the Git staged modified file segment
modified-stagedFollows the Git staged modified file segment when inactive
A_ newstringFollows Git new file segment
newFollows Git new file segment when inactive
@{push}push remote: stringPrecedes the Git push remote
@{u}remote: stringPrecedes the Git remote
skip-worktreestringFollows the Git skip-worktree file segment
skip-worktreeFollows the Git skip-worktree file segment when inactive
stashesstringFollows the Git stash segment
stashesFollows the Git stash segment when inactive
@tag: stringPrecedes the Git tag
?? untrackedstringFollows Git untracked file segment
untrackedFollows Git untracked file segment when inactive
**The default if GIT_PROMPT_KIT_VERBOSE_DEFAULT_SYMBOLS is non-zero.

* %% expands as % in the zsh prompt.