Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Prompt Structure

By default, the general appearance of the prompt is::

(<branch> <upstream branch> <branch tracking>|<local status>)

The symbols are as follows:

  • Local Status Symbols
    • : repository clean
    • ●n: there are n staged files
    • ✖n: there are n files with merge conflicts
    • ✖-n: there are n staged files waiting for removal
    • ✚n: there are n changed but unstaged files
    • …n: there are n untracked files
    • ⚑n: there are n stash entries
  • Upstream branch
    • Shows the remote tracking branch
    • Disabled by default
    • Enable by setting GIT_PROMPT_SHOW_UPSTREAM=1
  • Branch Tracking Symbols
    • ↑n: ahead of remote by n commits
    • ↓n: behind remote by n commits
    • ↓m↑n: branches diverged, other by m commits, yours by n commits
    • L: local branch, not remotely tracked
  • Branch Symbol:
    When the branch name starts with a colon :, it means it's actually a hash, not a branch (although it should be pretty clear, unless you name your branches like hashes :-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment