FISH_GIT_PROMPT(1)
πΈ FISH_GIT_PROMPT(1) πΈ
okay so bestie, welcome to the fish_git_prompt glow-up page β this is part of the fish-shell manual and honestly it's a little icon. Let's get into it π
β¨ NAME β¨
fish_git_prompt β spits out git info so your prompt can be cute and informed π
β¨ SYNOPSIS β¨
fish_git_prompt [FORMAT]
function fish_prompt
printf '%s' $PWD (fish_git_prompt) ' $ '
end
β¨ DESCRIPTION β¨
So fish_git_prompt shows you info about the git repo you're currently standing in, if there even is one. Main character energy for your prompt, fr fr.
Git <https://git-scm.com> has to be installed. no git, no vibes, no prompt info π«Ά
You can totally change the output format by passing an argument. The default value is " (%s)".
There are so many customization options and you can control them with git options or fish variables. Where a git option exists, it takes precedence over the fish variable with the same function. Git options can be set per-repository or globally β you set them with the git config command, and fish variables you set the usual way with the set command.
Boolean options (the ones that enable or disable stuff) understand "1", "yes" or "true" to mean true, and literally every other value means false. slay π
$__fish_git_prompt_show_informative_statusor the git optionbash.showInformativeStatusβ set to1,trueoryesto turn on the "informative" display, which shows a large amount of information: the number of dirty files, unpushed/unpulled commits, and more. β οΈ In large repositories this can take a lot of time, so you may wish to disable it in those repos withgit config --local bash.showInformativeStatus false. It also changes the characters the prompt uses to less plain ones (βinstead of*for the dirty state, for example), and if you're only interested in that part, set$__fish_git_prompt_use_informative_charsinstead.
Because counting untracked files takes a lot of time, the number of untracked files is only shown if enabled via $__fish_git_prompt_showuntrackedfiles or the git option bash.showUntrackedFiles.
$__fish_git_prompt_showdirtystateor the git optionbash.showDirtyStateβ set to1,trueoryesto show whether the repo is "dirty", i.e. it has uncommitted changes. π«§$__fish_git_prompt_showuntrackedfilesor the git optionbash.showUntrackedFilesβ set to1,trueoryesto show whether the repo has untracked files (the ones that aren't ignored).$__fish_git_prompt_showupstreamβ set it to a list of values to decide how changes between HEAD and upstream get shown:autoβ summarize the difference between HEAD and its upstreamverboseβ show number of commits ahead/behind (+/-) upstreamnameβ if verbose, then also show the upstream abbrev nameinformativeβ similar to verbose, but shows nothing when equal β this is the default if informative status is enabledgitβ always compare HEAD to@{upstream}svnβ always compare HEAD to your SVN upstreamnoneβ disables it (useful with informative status)
$__fish_git_prompt_showstashstateβ set to1,trueoryesto display the state of the stash. π$__fish_git_prompt_shorten_branch_lenβ set it to the number of characters the branch name will be shortened to.$__fish_git_prompt_describe_styleβ set it to one of these styles to describe the current HEAD:containsβ relative to newer annotated tag, such as(v1.6.3.2~35)branchβ relative to newer tag or branch, such as(master~4)describeβ relative to older annotated tag, such as(v1.6.3.1-13-gdd42c2f)defaultβ an exactly matching tag ((develop))
If none of these apply, the commit SHA shortened to 8 characters is used.
$__fish_git_prompt_showcolorhintsβ set to1,trueoryesto enable coloring for the branch name and status symbols. π
π Characters and colors, aka the aesthetic layer
A bunch of variables set the characters and colors used as indicators. Many of these have a different default when informative status is on, or when $__fish_git_prompt_use_informative_chars is set. The usual default is given first, then the informative default (if it's different). If no default for a color is given, they default to $__fish_git_prompt_color.
$__fish_git_prompt_char_stateseparator(' ',|) β the character used between the state characters$__fish_git_prompt_color(no default)$__fish_git_prompt_color_prefixβ the color of the(prefix$__fish_git_prompt_color_suffixβ the color of the)suffix$__fish_git_prompt_color_bareβ the color to use for a bare repository, i.e. one without a working tree$__fish_git_prompt_color_mergingβ the color when a merge/rebase/revert/bisect or cherry-pick is in progress π$__fish_git_prompt_char_cleanstate(βin informative mode) β the character used when nothing else applies$__fish_git_prompt_color_cleanstate(no default)
π§ Variables used with showdirtystate
$__fish_git_prompt_char_dirtystate(*,β) β the number of "dirty" changes, i.e. unstaged files with changes$__fish_git_prompt_char_invalidstate(#,β) β the number of "unmerged" changes, e.g. additional changes to already added files$__fish_git_prompt_char_stagedstate(+,β) β the number of staged files without additional changes$__fish_git_prompt_color_dirtystate(red with showcolorhints, same ascolor_flagsotherwise)$__fish_git_prompt_color_invalidstate$__fish_git_prompt_color_stagedstate(green with showcolorhints,color_flagsotherwise)
π¦ Variables used with showstashstate
$__fish_git_prompt_char_stashstate($,β)$__fish_git_prompt_color_stashstate(same ascolor_flags)
πΈ Variables used with showuntrackedfiles
$__fish_git_prompt_char_untrackedfiles(%,β¦) β the symbol for untracked files$__fish_git_prompt_color_untrackedfiles(same ascolor_flags)
π Variables used with showupstream (also implied by informative status)
$__fish_git_prompt_char_upstream_ahead(>,β) β the character for the commits this repo is ahead of upstream$__fish_git_prompt_char_upstream_behind(<,β) β the character for the commits this repo is behind upstream$__fish_git_prompt_char_upstream_diverged(<>,ββ) β the symbol if this repo is both ahead and behind upstream$__fish_git_prompt_char_upstream_equal(=) β the symbol if this repo is equal to upstream$__fish_git_prompt_char_upstream_prefix('')$__fish_git_prompt_color_upstream
π Colors used with showcolorhints
$__fish_git_prompt_color_branch(green) β the color of the branch if nothing else applies$__fish_git_prompt_color_branch_detached(red) β the color of the branch if it's detached (e.g. a commit is checked out)$__fish_git_prompt_color_branch_dirty(no default) β the color of the branch if it's dirty and not detached$__fish_git_prompt_color_branch_staged(no default) β the color of the branch if it just has something staged and is otherwise clean$__fish_git_prompt_color_flags(--bold blue) β the default color for dirty/staged/stashed/untracked state
π‘ Note that all colors can also have a corresponding_donecolor. For example, the contents of$__fish_git_prompt_color_upstream_doneis printed right after the upstream. iykyk π
Also go look at fish_vcs_prompt, which calls all the supported version control prompt functions, including git, Mercurial and Subversion. π«Ά
β¨ EXAMPLE β¨
A simple prompt that displays git info, no cap:
function fish_prompt
# ...
set -g __fish_git_prompt_showupstream auto
printf '%s %s$' $PWD (fish_git_prompt)
end
β¨ Copyright β¨
fish-shell developers π
and that's the whole page bestie!! β¨πβ¨ brought to you by fish-shell version 4.9, dated Sep 08, 2026 β this was FISH_GIT_PROMPT(1), mwah, go make your prompt gorgeous ππ¦π
π¦ where this page comes from
- arch rolling: fish 4.9.3-1 Β· GPL-2.0-only AND BSD-3-Clause AND ISC AND MIT AND PSF-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms