I'm using something similar, but ran into a problem recently: go into a detached head mode (`git checkout HEAD^`). ALL your branches (local and remote) are spat out into your PS1. It's rare enough that I haven't looked into fixing it, but have any suggestions?
The best thing I ever did for my prompt was switch to zsh and start using oh-my-zsh[1]. Zsh itself has a handful of interesting features, but oh-my-zsh's built-in prompt theme support means I can cycle through prompts (most of which also include git or rvm info) with impunity.
I'm currently using[1] a PS1 that shows branch name, whether any files in the repo need to be staged or committed and whether the repo is behind or ahead of the remote. (Credit to Adam Vandenberg[2] and Brian Carper[3] for whatever good ideas it contains.)
My major step forward in bash prompt setup earlier this year was realising it didn't have to be a single line.
I have one info line which tells me path, user, host, git branch etc. And then the prompt sits nicely on the line below and is always at the same alignment.
* ugh * does anyone actually like that avatar animation, and the slow scrolling that results from it?
I find the comments here far more useful, and they aren't one-line commands with no explanation of the parts. Thanks for the submission, for the discussion's sake, but I'm not going back to that blog any time soon.
Shows the ruby version, rvm gemset, working directory and git branch, followed by a thunderbolt prompt. This is how I set it https://gist.github.com/1120566
[+] [-] SeoxyS|14 years ago|reply
http://akhun.com/seo/skitch/Screen_Shot_2011-08-02_at_8.47.1...
[+] [-] Groxx|14 years ago|reply
[+] [-] generalk|14 years ago|reply
[1]: https://github.com/robbyrussell/oh-my-zsh
[+] [-] telemachos|14 years ago|reply
Here's what it looks like: http://cl.ly/8y50
[1] https://github.com/telemachus/dotfiles/blob/master/bashrc
[2] https://github.com/adamv/dotfiles/blob/master/bashrc
[3] http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
[+] [-] glenjamin|14 years ago|reply
I have one info line which tells me path, user, host, git branch etc. And then the prompt sits nicely on the line below and is always at the same alignment.
http://i.imgur.com/0F6qt.png
[+] [-] glenjamin|14 years ago|reply
[+] [-] jkmcf|14 years ago|reply
136 11:33:48 $
export PS1='\[\e[32m\]\u@\h \[\033[33m\]\w\[\033[00m\] $(__git_ps1 "(%s)") ${rvm_ruby_string}\n\# \[\033[31m\] \[\033[00m\]\t \\$ '
[+] [-] drothlis|14 years ago|reply
http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/comple...
[+] [-] callahad|14 years ago|reply
Screenshots from the article:
http://stevelosh.com/media/images/blog/2010/02/zsh-prompt.pn...
http://stevelosh.com/media/images/blog/2010/02/zsh-prompt-co...
[+] [-] Groxx|14 years ago|reply
I find the comments here far more useful, and they aren't one-line commands with no explanation of the parts. Thanks for the submission, for the discussion's sake, but I'm not going back to that blog any time soon.
[+] [-] bryckbost|14 years ago|reply
Which browser and OS are you using? Scrolling isn't slow in webkit for myself, but I'd be happy to dig in and make it smoother if it's an issue.
[+] [-] SingAlong|14 years ago|reply
1.9.2@rails31::project(branch)⚡
Shows the ruby version, rvm gemset, working directory and git branch, followed by a thunderbolt prompt. This is how I set it https://gist.github.com/1120566
[+] [-] jsjohns2|14 years ago|reply
[+] [-] bryckbost|14 years ago|reply
[+] [-] swah|14 years ago|reply