I added __git_ps1 to my PS1 in .bash_profile, now I'm getting (master) for all folders that aren't git repos.
- by Matthew
I'm on a Mac (10.6.5). Here's an example of what's going wrong:
[m@m ~ (master)]$ cd ~/Documents
[m@m ~/Documents (master)]$ cd ~/Applications
[m@m ~/Applications (master)]$ cd ~/Library
[m@m ~/Library (master)]$ cd ~/Sites/somesite
[m@m ~/Sites/somerepo (FEATURE_SOMEFEATURE)]$
Here's the relevant contents of my .bash_profile:
source ~/.git-completion.bash
PS1='[\u@\h \w$(__git_ps1 " (%s)")]\$ '
I'm using the standard git-completion script - I just copied it to my home directory.