Last active
December 11, 2015 21:49
-
-
Save ademuk/4665194 to your computer and use it in GitHub Desktop.
Adding your current GIT branch to your command prompt.
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
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
NO_COLOUR="\[\033[0m\]" | |
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export PS1="\[\e]0;\u:\w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\]:\w\[\033[00m\]$YELLOW\$(parse_git_branch)$NO_COLOUR\$" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment