Create a gist now

Instantly share code, notes, and snippets.

Embed
color your prompt and show git branch
#color and git branch
parse_git_branch() {··
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export CLICOLOR=1
export GREP_OPTIONS="--color"
export LSCOLORS=gxfxcxdxbxegedabagacad
PS1='\n\[\e[1;36m\]\w \[\e[m\]\[\e[1;33m\]$(parse_git_branch)\[\e[m\] \n> '
@numberwhun

This comment has been minimized.

Show comment
Hide comment
@numberwhun

numberwhun Sep 14, 2011

I love the little Apple symbol for the prompt. Thanks! :)

Just for clarification, how exactly does this operate? If you edit a git branch does it automatically change your prompt to show the branch your editing?

I love the little Apple symbol for the prompt. Thanks! :)

Just for clarification, how exactly does this operate? If you edit a git branch does it automatically change your prompt to show the branch your editing?

@jtmkrueger

This comment has been minimized.

Show comment
Hide comment
@jtmkrueger

jtmkrueger Sep 14, 2011

you'll see the current brnach your working in next to your path. The regex parses the branch name

Owner

jtmkrueger commented Sep 14, 2011

you'll see the current brnach your working in next to your path. The regex parses the branch name

@numberwhun

This comment has been minimized.

Show comment
Hide comment
@numberwhun

numberwhun Sep 14, 2011

That's what I figured / hoped. Thanks!

That's what I figured / hoped. Thanks!

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