您的位置:首页 > 其它

git 彩色显示当前branch

2014-11-24 22:42 190 查看
环境: fedora 20

$ curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh

############################## 以下内容放入 ~/.bashrc ################################
source ~/.git-prompt.sh

# Bash completion
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

export GIT_PS1_SHOWDIRTYSTATE=1

export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '
###################################################################
$ source ~/.bashrc
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: