mac环境 git 子命令 补全:

烂漫一生 提交于 2019-12-09 14:57:17

 

1.安装 :home-brew (包管理工具)—官网:  http://brew.sh/

2.命令 : /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

3.安装 bash-completion:      命令: brew install bash-completion

4.查找文件  :   sudo find / -name git-completion.bash

5.拷贝文件  :  cp /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash ~/.git-completion.bash

6.source 文件:  source ~/.git-completion.bash

7.修改或创建文件: ~/.bash_profile  内容为:

if [ -f ~/.bashrc ]; then

   source ~/.bashrc

fi

8.增加或修改 .bashrc 内容为:

source ~/.git-completion.bash

 

9.重启终端

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!