Created
June 11, 2014 15:01
-
-
Save wesleywillians/c19e50ba979e825c7607 to your computer and use it in GitHub Desktop.
Color Git Terminal
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
function git_branch_name() { | |
git branch 2>/dev/null | grep -e '^*' | sed -E 's/^\* (.+)$/(\1) /' | |
} | |
function show_colored_git_branch_in_prompt() { | |
PS1="\[\033[38m\]\h:\[\033[032m\]\W\[\033[31m\]\$(git_branch_name)\[\033[m\]$ " | |
} | |
show_colored_git_branch_in_prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment