Components

To use Git Prompt Kit's components in a custom prompt, load Git Prompt Kit and then refer to any of its components.

For example, to create the minimal prompt <current working directory> [<Git HEAD> ]% :

Minimal configuration, using Git Prompt Kit for the Git part only:

# ~/.zshrc
# --- snip ---
# Load Git Prompt Kit (will differ depending on installation method)
PROMPT='%1d ${GIT_PROMPT_KIT_HEAD:+$GIT_PROMPT_KIT_HEAD }%% '

Using Git Prompt Kit for everything

# ~/.zshrc
# --- snip ---
# Load Git Prompt Kit (will differ depending on installation method)
PROMPT='$GIT_PROMPT_KIT_CWD ${GIT_PROMPT_KIT_HEAD:+$GIT_PROMPT_KIT_HEAD }$GIT_PROMPT_KIT_CHAR '

Atom components

NameTypeDescription
GIT_PROMPT_KIT_ACTIONprompt stringGit: current action (e.g. "rebase")
GIT_PROMPT_KIT_AHEADprompt stringGit: commits ahead of the upstream
GIT_PROMPT_KIT_ASSUMED_UNCHANGEDprompt stringGit: assume-unchanged files count
GIT_PROMPT_KIT_BEHINDprompt stringGit: commits behind the upstream
GIT_PROMPT_KIT_CHARprompt stringPrompt character
GIT_PROMPT_KIT_CONFLICTEDprompt stringGit: conflicted files count
GIT_PROMPT_KIT_DELETEDprompt stringGit: unstaged deleted files count
GIT_PROMPT_KIT_DELETED_STAGEDprompt stringGit: staged deleted files count
GIT_PROMPT_KIT_HEADprompt stringGit: HEAD (branch or commit)
GIT_PROMPT_KIT_MODIFIEDprompt stringGit: unstaged modified files count
GIT_PROMPT_KIT_MODIFIED_STAGEDprompt stringGit: staged modified files count
GIT_PROMPT_KIT_NEWprompt stringGit: (staged) new files count
GIT_PROMPT_KIT_PUSH_AHEADprompt stringGit: commits ahead of the push remote
GIT_PROMPT_KIT_PUSH_BEHINDprompt stringGit: commits behind the push remote
GIT_PROMPT_KIT_PUSHprompt stringGit: push remote if not the default
GIT_PROMPT_KIT_REMOTEprompt stringGit: GIT_PROMPT_KIT_LOCAL if no upstream; upstream branch if the name differs from the local branch; upstream remote and branch if the remote is not the default
GIT_PROMPT_KIT_REPO_ROOTprompt stringGit root directory, underlined, with trailing directories.
GIT_PROMPT_KIT_REPO_SUBDIRECTORYprompt stringSubdirectory relative to the Git root
GIT_PROMPT_KIT_SKIP_WORKTREEprompt stringGit: skip-worktree files count
GIT_PROMPT_KIT_STASHESprompt stringGit: stash count
GIT_PROMPT_KIT_TAGprompt stringGit: up to one tag at HEAD
GIT_PROMPT_KIT_UNTRACKEDprompt stringGit: untracked (not staged) files count
GIT_PROMPT_KIT_USERHOSTprompt stringUser (if not configured as hidden) and host (if not configured as hidden)

Molecule components

NameTypeDescription
GIT_PROMPT_KIT_CHARprompt stringGIT_PROMPT_KIT_SYMBOL_CHAR_NORMAL or GIT_PROMPT_KIT_SYMBOL_CHAR_ROOT
GIT_PROMPT_KIT_CWDprompt stringIf in a Git repo, GIT_PROMPT_KIT_REPO_ROOT and GIT_PROMPT_KIT_REPO_SUBDIRECTORY. Otherwise current working directory with trailing directories. Relative to $HOME.
GIT_PROMPT_KIT_REFprompt stringGIT_PROMPT_KIT_HEAD, GIT_PROMPT_KIT_AHEAD, GIT_PROMPT_KIT_BEHIND, GIT_PROMPT_KIT_REMOTE, GIT_PROMPT_KIT_PUSH, GIT_PROMPT_KIT_PUSH_AHEAD, GIT_PROMPT_KIT_PUSH_BEHIND, and GIT_PROMPT_KIT_TAG
GIT_PROMPT_KIT_STATUSprompt stringGIT_PROMPT_KIT_UNTRACKED, GIT_PROMPT_KIT_CONFLICTED, GIT_PROMPT_KIT_DELETED, GIT_PROMPT_KIT_MODIFIED, GIT_PROMPT_KIT_NEW, GIT_PROMPT_KIT_DELETED_STAGED, and GIT_PROMPT_KIT_MODIFIED_STAGED
GIT_PROMPT_KIT_STATUS_EXTENDEDprompt stringGIT_PROMPT_KIT_STASHES, GIT_PROMPT_KIT_ASSUMED_UNCHANGED, and GIT_PROMPT_KIT_SKIP_WORKTREE

Other components

NameTypeDescription
GIT_PROMPT_KIT_DIRTYnumberEqual to 1 if the Git working tree is dirty, otherwise unset