Display git branch name in bash prompt
This commit is contained in:
parent
1a494c6c38
commit
bcc21781b0
|
@ -19,4 +19,10 @@ export TMP=/tmp
|
|||
export TEMP=/tmp
|
||||
export TMPDIR=/tmp
|
||||
|
||||
parse_git_branch() {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||
}
|
||||
|
||||
export PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \w\[\033[33m\]\n$(parse_git_branch)\[\033[0;32m\]\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\]\[\033[0m\] '
|
||||
|
||||
cd ~
|
||||
|
|
Loading…
Reference in New Issue
Block a user