git在terminal中自动补全

1. curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash

2. 在~/.bash_profile中加如下内容:

if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fi

3. If this doesn't work off the bat, you may need to run chmod -X ~/.git-completion.bash to give the script permission to run.

4. Restart terminal

详细见:http://apple.stackexchange.com/questions/55875/git-auto-complete-for-branches-at-the-command-line

 
posted @ 2014-11-14 11:21  阳芳  阅读(342)  评论(0)    收藏  举报