Skip to content

Instantly share code, notes, and snippets.

@cwsaylor
Created March 2, 2011 18:14
Show Gist options
  • Save cwsaylor/851402 to your computer and use it in GitHub Desktop.
Save cwsaylor/851402 to your computer and use it in GitHub Desktop.
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\h:\W (\$(~/.rvm/bin/rvm-prompt i v g s))\$(parse_git_branch)\$ "
@brupm
Copy link

brupm commented Mar 2, 2011

This is mine:

function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^_]/d' -e 's/_ (.*)/(\1)/'
}
export PS1='\w[\033[1;34m]$(parse_git_branch): [\e[1;37m][\e[0m]'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment