Skip to content

Instantly share code, notes, and snippets.

@burnto
Created September 7, 2011 00:20
Show Gist options
  • Save burnto/1199387 to your computer and use it in GitHub Desktop.
Save burnto/1199387 to your computer and use it in GitHub Desktop.
bash_profile git status in prompt
# GIT COMPLETION
# (from https://github.com/git/git/blob/master/contrib/completion/git-completion.bash)
source ~/.git-completion.sh
# BASH PROMPT WITH GIT BRANCH
# Set the base PS1
# PS1="\u:\h \W$ "
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " \[\033[01;35m\](%s)\[\033[0m\]")$ '
export GIT_PS1_SHOWDIRTYSTATE=1
@huned
Copy link

huned commented Sep 9, 2011

Do you find this useful or noisy?

@burnto
Copy link
Author

burnto commented Sep 9, 2011

super useful. only shows up when i'm cd'd into in a git project directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment