Brew, Git 1.8.0 & "-bash: __git_ps1: Command Not Found"

I updated my machine this past weekend. This included everything from Mountain Lion to Homebrew (including all formulas).

As part of this update I moved from git 1.7.2.x to 1.8.0. After I did so and launched a new terminal I started seeing this fun error

-bash: __git_ps1: command not found

I checked the git 1.8.0 release notes but could not see any mention of a change to the prompt scripts. After much research (and gnashing of teeth) I discovered that the git shell commands that were responsible for making that nice prompt were moved from contrib/completion/git-completion.bash into a separate file contrib/completion/

To fix it I added the following line to my ~/.bash_profile above where I defined my prompt

source /usr/local/etc/bash_completion.d/

Where /usr/local/etc/bash_completion.d is where brew puts the completion scripts it installs.

I am no bash guru so I will not advocate that this is the best way to fix this problem.If you are a bash guru and know a better way please comment so we can all learn something.