Created
April 30, 2012 02:50
-
-
Save todb/2555109 to your computer and use it in GitHub Desktop.
Stick this in your bashrc and don't wonder what branch/ruby/gemset you're using
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git and RVM prompting | |
function git-current-branch { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /' | |
} | |
export PS1="[\$(~/.rvm/bin/rvm-prompt v p g)] \$(git-current-branch)$PS1" |
Very good but I don't like that it's showing up [ ] before promt while in interactive shell.
I commented that, and uncomment only when needed.
thank you for sharing :)
You could use git branch 2> /dev/null | sed -n 's/^\* //p'
and put the parens in your $PS1
. :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of today, it looks like rvm-prompt once again functions correctly.