Skip to content

Instantly share code, notes, and snippets.

@gshutler
Created December 30, 2011 15:26
Show Gist options
  • Select an option

  • Save gshutler/1540305 to your computer and use it in GitHub Desktop.

Select an option

Save gshutler/1540305 to your computer and use it in GitHub Desktop.
Installing bash git completion and display of active branch

Install bash git completion (I used homebrew).

Then alter the end of your .bash_profile to be this:

NO_COLOR="\033[0m"
GRAY="\033[90m"

if [ -f /usr/local/etc/bash_completion.d/git-completion.bash ]; then
  . /usr/local/etc/bash_completion.d/git-completion.bash;
  PS1='\W $(__git_ps1 "$GRAY%s$NO_COLOR ")\$ ';
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment