转载 :https://blog.csdn.net/tiancaijyy/article/details/84888868

 

注意:

获取git-completion.bash  要对应自己的git版本   (git --version 查看)

访问  https://raw.githubusercontent.com/git/git/v2.17.2/contrib/completion/git-completion.bash

获取到的git-completion.bash  放入  /usr/local/opt/bash-completion/etc/bash_completion.d/

终端输入 :

brew unlink bash-completion

brew link bash-completion

重启终端后生效

 

如果mac  shell用的不是 bash 以上就没效果了

mac终端bash、zsh、oh-my-zsh最实用教程https://blog.csdn.net/www1575066083/article/details/103164811

 

 

 

 

curl  https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash

# 添加到 .bash_profile 
vim ~/.bash_profile 

# 添加内容
if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fi

# 保存后刷新
source ~/.bash_profile

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2022-02-26
  • 2021-11-17
  • 2022-12-23
  • 2022-01-14
猜你喜欢
  • 2021-12-23
  • 2021-11-22
  • 2022-01-12
  • 2022-12-23
  • 2021-09-22
  • 2021-11-14
  • 2022-12-23
相关资源
相似解决方案