git自动补全

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!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容