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_status or the git option bash.showInformativeStatus β€” set to 1, true or yes to 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 with git 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_chars instead.

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_showdirtystate or the git option bash.showDirtyState β€” set to 1, true or yes to show whether the repo is "dirty", i.e. it has uncommitted changes. 🫧
  • $__fish_git_prompt_showuntrackedfiles or the git option bash.showUntrackedFiles β€” set to 1, true or yes to 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 upstream
    • verbose β€” show number of commits ahead/behind (+/-) upstream
    • name β€” if verbose, then also show the upstream abbrev name
    • informative β€” similar to verbose, but shows nothing when equal β€” this is the default if informative status is enabled
    • git β€” always compare HEAD to @{upstream}
    • svn β€” always compare HEAD to your SVN upstream
    • none β€” disables it (useful with informative status)
  • $__fish_git_prompt_showstashstate β€” set to 1, true or yes to 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 to 1, true or yes to 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 as color_flags otherwise)
  • $__fish_git_prompt_color_invalidstate
  • $__fish_git_prompt_color_stagedstate (green with showcolorhints, color_flags otherwise)

πŸ¦‹ Variables used with showstashstate

  • $__fish_git_prompt_char_stashstate ($, βš‘)
  • $__fish_git_prompt_color_stashstate (same as color_flags)

🌸 Variables used with showuntrackedfiles

  • $__fish_git_prompt_char_untrackedfiles (%, …) β€” the symbol for untracked files
  • $__fish_git_prompt_color_untrackedfiles (same as color_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 _done color. For example, the contents of $__fish_git_prompt_color_upstream_done is 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

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