Skip to content

Instantly share code, notes, and snippets.

@davidrobert
Created February 27, 2012 23:18
Show Gist options
  • Save davidrobert/1927854 to your computer and use it in GitHub Desktop.
Save davidrobert/1927854 to your computer and use it in GitHub Desktop.
GIT + .bash_profile" (ou ".bashrc")
# Fonte: http://vidageek.net/2009/07/20/como-exibir-branch-atual-do-git/
export PS1="\[\033[38m\]\u\[\033[32m\] \w \[\033[31m\]\`git \\
branch 2>/dev/null | grep \"^\*\" | \\
sed -r \"s/\*\ (.*)/ \(\1\)/\"\`\[\033[37m\]$\[\033[00m\] "
## Mac version:
#
#PS1="\[\033[38m\]\u";
#PS1="$PS1\[\033[32m\] \w";
#PS1="$PS1\[\033[31m\]";
#PS1="$PS1\`git branch 2>/dev/null | grep \"^\*\" | \\
# sed 's/\*\ \(.*\)/ (\1)/'\`"
#export PS1="$PS1\[\033[37m\]$\[\033[00m\]";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment