Git无法Push和Clone?试试科学上网方法

Git无法Push和Clone?试试科学上网方法

Sucan
2021-09-05 / 1 评论 / 319 阅读 / 正在检测是否收录...

今天在使用Git工具的时候 老是出现网络错误 遂在网上进行了一番检索,特此记录

  • 设置代理
git config --global http.proxy http://127.0.0.1:54321        //http的代理
git config --global https.proxy https://127.0.0.1:54321       //https的代理
  • 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
  • 测试是否能连接github

    ssh -T git@github.com

查看所有git配置

git config -l

问题:

warning: http.proxy has multiple values

方法:

git config --global --unset-all  http.proxy
git config --global --unset-all  https.proxy
git config --global user.name  "name"   //你的GitHub登陆名
git config --global user.email "@qq.com"   //你的GitHub注册邮箱
0

评论 (1)

取消