I'm trying to add the git branch to my Terminal prompt by editing the bash profile but cannot determine why it's not working--haven't been able to apply the answers to any of the other posted questions. Here is what is in my profile now:
if [ -f $(brew --prefix)/etc/bash_completion.d/git-prompt.sh ]; then
source $(brew --prefix)/etc/bash_completion.d/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=1
PS1='\w$(__git_ps1) \n\$ '
fi
For the record, when I ran brew install bash-completion
, it did not create git-prompt.sh in the bash_completion.d directory.