CentOS上用yum装好git以后,默认没有命令补全。需要简单配置一下。
1.编辑 ~/.bash_profile 文件,添加以下内容
1 2 3 4 5 | if [ -f /etc/bash_completion .d /git ]; then . /etc/bash_completion .d /git fi export GIT_PS1_SHOWDIRTYSTATE= true PS1= '[\u@\h \W\[\033[01;32m\]$(__git_ps1 "(%s)")\[\033[00m\]]\$ ' |
2.应用修改
source ~/.bash_profile
修改之后的效果如下图: