原因:直接安装的git 缺少配置文件

解决步骤:

1、下载配置文件

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

 

2、复制git配置文件

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

注:如果git pull速度过慢,可以忽略以上两步,直接下载单独的文件

cd ~/
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
mv ~/git-completion.bash ~/.git-completion.bash

 

3、把这句话生效的命令添加到 .bashrc 里

echo "source ~/.git-completion.bash" >> ~/.bashrc

 

4、重新加载 .bashrc 文件

sourch  ~/.bashrc

 

相关文章:

  • 2021-04-21
  • 2021-05-29
  • 2021-06-18
  • 2021-09-22
  • 2021-11-14
  • 2022-12-23
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2021-12-15
  • 2021-12-17
  • 2021-11-11
  • 2021-08-24
相关资源
相似解决方案