第一步:
下載下傳git-completion.bash
https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
第二步:
将git-completion.bash放到某個目錄下如:~/.git-completion.bash
第三步:
修改.bashrc
在最後添加一句:
source "/Users/xxx/.git-completion.bash"
建議使用絕對路徑
第四步
重新開機.bashrc
執行 source ~/.bashrc