码迷,mamicode.com
首页 > 其他好文 > 详细

配合Git修改PS1

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

标签:blog   http   color   io   ar   amp   line   log   

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

标签:blog   http   color   io   ar   amp   line   log   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!