about 7 years ago

Show git branch

  • Install bash-completion

    brew install bash-completion
    
  • 編輯 ~/.bash_profile,加入以下內容

    # Bash completion
    if [ -f /etc/bash_completion ]; then
        . /etc/bash_completion
    fi
    

    and

    export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '
    

Show pending changes

  • 編輯 ~/.bash_profile

    export GIT_PS1_SHOWDIRTYSTATE=1
    

References

← Import Git Project to Eclipse Add Git Auto Completion in Bash Prompt →
 
comments powered by Disqus