美文网首页
git自动补全

git自动补全

作者: 寻雨的人 | 来源:发表于2017-01-04 08:08 被阅读53次

1.安装git配套脚本完全版

brew install bash-completion

安装完成后会有一段提示:

Add the following lines to your ~/.bash_profile:

if [ -f $(brew --prefix)/etc/bash_completion ]; then

. $(brew --prefix)/etc/bash_completion

fi

2.将if...then之间的语句添加到bash_profile中

3.下载git源码,获取git-completion.bash文件,路径:contrib/completion/git-completion.bash

git clone https://github.com/git/git.git

4.复制到根目录并改名为.git-completion.bash

cp git-completion.bash ~/.git-completion.bash

5.添加下面语句到~/.bash_profile

source ~/.git-completion.bash

重启shell终端,ok!

相关文章

网友评论

      本文标题:git自动补全

      本文链接:https://www.haomeiwen.com/subject/suhovttx.html