只需要完成下面两部,就可以实现在mac osx 下git 命令自动补齐,自动补全之后可以不用记住那么多命令了。
首先下载自动补齐脚本,使用curl命令如下:
1
2
|
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash \
–o ~/.git–completion.bash
|
编辑.profile 文件,在最后增加如下代码:
1
2
3
|
if [ –f ~/.git–completion.bash ]; then
source ~/.git–completion.bash
fi
|
重启终端后应该就可以使用tab自动补全
文章转载来自:ttlsa.com