.bash_profile备份
# ~/.bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs none="\033[0m" black="\033[0;30m" dark_gray="\033[1;30m" blue="\033[0;34m" light_blue="\033[1;34m" green="\033[0;32m" light_green="\033[1;32m" cyan="\033[0;36m" light_cyan="\033[1;36m" red="\033[0;31m" light_red="\033[1;31m" purple="\033[0;35m" light_purple="\033[1;35m" brown="\033[0;33m" yellow="\033[1;33m" light_gray="\033[0;37m" white="\033[1;37m" find_git_branch () { local dir=. head until [ "$dir" -ef / ]; do if [ -f "$dir/.git/HEAD" ]; then head=$(< "$dir/.git/HEAD") if [[ $head = ref:\ refs/heads/* ]]; then git_branch="[${head#*/*/}]" elif [[ $head != '' ]]; then git_branch="(detached)" else git_branch="(unknow)" fi return fi dir="../$dir" done git_branch='' } PROMPT_COMMAND="find_git_branch; $PROMPT_COMMAND" PS1="$cyan\u$none@$cyan\h$none:$green\w$brown\$git_branch$none\$ " PATH=$PATH:$HOME/bin export PATH
作者:阿良
出处:http://www.cnblogs.com/arliang
本文采用知识共享署名-非商业性使用-相同方式共享 2.5 中国大陆许可协议
进行许可,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。