今天看Railscasts,才发现可以在命令行显示git分支,找到2篇帖子,把他们融合了一下:
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! # visit https://wiki.archlinux.org/index.php/Color_Bash_Prompt for more color. WHITE="\[\033[0m\]" YELLOW="\[\033[0;33m\]" export PS1="\w:$YELLOW\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)$WHITE\$ "

