Skip to content

Instantly share code, notes, and snippets.

@kevinmarx
Last active December 23, 2015 06:29
Show Gist options
  • Save kevinmarx/6594480 to your computer and use it in GitHub Desktop.
Save kevinmarx/6594480 to your computer and use it in GitHub Desktop.
Git flags for showing state in bash
export PS1="\e[36;40m\W\e[0m \e[35;40m\$(__git_ps1 ' (%s)') \e[0m\]\n\$ "
# for more info, http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/completion/git-completion.bash;hb=HEAD
# __git_ps1 flags
# show * if there are untracked changes and + if staged and uncommitted changes
export GIT_PS1_SHOWDIRTYSTATE=1
# show $ if there are stashed changes
export GIT_PS1_SHOWSTASHSTATE=1
# show % if there are untracked files
export GIT_PS1_SHOWUNTRACKEDFILES=1
# show < if there are unpulled changes, > if there are unpushed changes, or <> if there are both
export GIT_PS1_SHOWUPSTREAM=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment