Last active
December 21, 2015 06:49
-
-
Save kran/6266751 to your computer and use it in GitHub Desktop.
ps1
This file contains 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
git-branch-name() { | |
git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3 | |
} | |
git-branch-prompt() { | |
local branch=`git-branch-name` | |
if [ "$branch" != "" ]; then | |
printf "[\033[1;33m${branch}\033[0m]" | |
fi | |
} | |
CNONE="\[\033[0m\]" | |
CG="\[\033[0;32m\]" | |
CC="\[\033[0;36m\]" | |
CBR="\[\033[1;41m\]" | |
UC=$CNONE | |
UP="\$" | |
if [ $UID -eq "0" ] ; then | |
UC=$CBR | |
UP="#" | |
fi | |
export PS1="\[$(tput setaf 1)\]\u@\h:\w \[$(tput sgr0)\]\$(git-branch-prompt)${CNONE} $ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment