I added __git_ps1 to my PS1 in .bash_profile, now I'm getting (master) for all folders that aren't git repos.
Posted
by
Matthew
on Super User
See other posts from Super User
or by Matthew
Published on 2010-11-17T13:26:41Z
Indexed on
2010/12/23
15:55 UTC
Read the original article
Hit count: 173
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.
© Super User or respective owner