MAC中git自动补全配置
git自动补全
通过Brew安装bash-completion
brew install bash-completion安装后通过brew list命令查看安装是否成功查看bash-completion安装信息
brew info bash-comletion我的在terminal中展示 添加
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"至.bash_profile文件中,根据各自输出情况而定通过
git --verison命令查看git版本,并用自己机器上的版本号替换网址https://raw.githubusercontent.com/git/git/v2.x.x/contrib/completion/git-completion.bash中的2.x.x,另存为git-completion.bash文件拷贝第3步骤中保存的
git-completion.bash文件至目录/usr/local/opt/bash-completion/etc/bash_completion.d中执行命令
1
2brew unlink bash-completion
brew link bash-completion