git 命令自动补全的方法
<p>只需要完成下面两部,就可以实现在mac osx 下git 命令自动补齐,自动补全之后可以不用记住那么多命令了。</p><p>首先下载自动补齐脚本,使用curl命令如下:</p><pre class="brush:bash;toolbar:false">curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash \
-o ~/.git-completion.bash</pre><p>编辑.profile 文件,在最后增加如下代码:</p><pre class="brush:bash;toolbar:false">if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
fi</pre><p>重启终端后应该就可以使用tab自动补全</p>
頁:
[1]