Skip to content

Instantly share code, notes, and snippets.

@jimbeaudoin
Created October 15, 2014 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimbeaudoin/b612c9ccdd3fcc3d427d to your computer and use it in GitHub Desktop.
Save jimbeaudoin/b612c9ccdd3fcc3d427d to your computer and use it in GitHub Desktop.
Show BranchName, DirtyState and UntrackedFiles for Git in Bash
# Download this File:
# https://github.com/git/git/blob/8976500cbbb13270398d3b3e07a17b8cc7bff43f/contrib/completion/git-prompt.sh
source ~/.git-prompt.sh
# Show Dirty(*,+) and Untracked(%) Files
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
# Update Bash Prompt
PS1='\u@\h:\W$(__git_ps1 " (%s)")\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment