首页 > 其他 > 详细

配合Git修改PS1

时间:2014-08-13 00:46:44      阅读:840      评论:0      收藏:0      [点我收藏+]

1.export PS1=‘\u@\h:\[\033[1;34m\]\w\[\033[0;33m\]$(git branch 2> /dev/null | sed -e ‘/^[^*]/d‘ -e "s/* \(.*\)/[\1$([[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*")]/")\[\e[0m\]$ ‘

source:http://ryansechrest.com/2013/11/bash-shell-prompt-dissected-display-git-branch-name-status-color/

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

source:http://code-worrier.com/blog/git-branch-in-bash-prompt/

3.export PS1=‘\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 "(%s)") \[\033[01;34m\]$\[\033[00m\] ‘

source:http://makandracards.com/makandra/524-show-the-current-git-branch-on-your-bash-prompt

配合Git修改PS1,布布扣,bubuko.com

配合Git修改PS1

原文:http://www.cnblogs.com/zuliu/p/3908694.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!