The fish_git_prompt function can be used to display information about the current git repository, if any.
For obvious reasons, it requires having git installed.
There are numerous configuration options, either as fish variables or git config variables. If a git config variable is supported, it will be used if set, and the fish variable will only be used if it isn't.
- $__fish_git_prompt_show_informative_status or the git config option "bash.showInformativeStatus" can be set to enable the "informative" display, which will show a large amount of information - the number of untracked files, dirty files, unpushed/unpulled commits, etc... In large repositories, this can take a lot of time, so it is recommended to disable it there, via ``git config bash.showInformativeStatus false``.
- $__fish_git_prompt_showdirtystate or the git config option "bash.showDirtyState" can be set to show if the repository is "dirty", i.e. has uncommitted changes.
- $__fish_git_prompt_showuntrackedfiles or the git config option "bash.showUntrackedFiles" can be set to show if the repository has untracked files (that aren't ignored).
- $__fish_git_prompt_showupstream can be set to a number of values to determine how changes between HEAD and upstream are shown:
verbose show number of commits ahead/behind (+/-) upstream
name if verbose, then also show the upstream abbrev name
A number of variables to set characters and color used to indicate things. Many of these have a different default if used with informative status enabled.