- 终端执行
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
- ~/.bash_profile文件添加以下内容
test -f ~/.git-completion.bash && . $_
.bash_profile文件在finder小房子图标下的根目录,如果找不到可能是隐藏了,使用 command+shift+.
切换是否显示隐藏文件。
如果还没有就新建一个。
- 重新打开gitbash,就可以使用
git branch
+Tab ,git checkout
+Tab