版權聲明:本文為博主原創(chuàng)文章,未經博主允許不得轉載。
- 你可以在終端執(zhí)行如下命令,輸出下載好的.bash到相應目錄:
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
- 或者直接去github上下載git-completion.bash文件
1 cp git-completion.bash ~/.git-completion.bash (第二種方式下載.bash時使用)
2 vim ~/.bash_profile
3 source ~/.git-completion.bash
4 . ~/.bash_profile
最后,重新退出終端再打開,當你使用git [tab][tab]就可以發(fā)現已經能夠自動補全啦~