Adding git branch to bash prompt on snow leopard
Posted
by crayment
on Super User
See other posts from Super User
or by crayment
Published on 2010-03-19T08:21:10Z
Indexed on
2010/03/19
8:31 UTC
Read the original article
Hit count: 367
I am using this:
$(__git_ps1 '(%s)')
It works however it does not update when I change directories or checkout a new branch. I also have this alias:
alias reload='. ~/.bash_profile'
Sample run:
user@machine:~/dev/rails$cd git_folder/
user@machine:~/dev/rails/git_folder$reload
user@machine:~/dev/rails/git_folder(test)$git checkout master
Switched to branch 'master'
user@machine:~/dev/rails/git_folder(test)$reload
user@machine:~/dev/rails/git_folder(master)$
As you can see it is being set correctly but only if I reload bash_profile. I have wasted way to much time on this. I am using bash on snow leopard. Please help!
© Super User or respective owner