当前位置:   article > 正文

git解决无法上传fatal: unable to access ‘http://xxxx.git/‘: The requested URL returned error等一系列问题_the requested url returned error: 502

the requested url returned error: 502

git解决无法上传fatal: unable to access 'http://xxxx.git/': The requested URL returned error等一系列问题
在使用Git上传代码到远程仓库时,走到git push origin master推送这一步的时候,可能会出现各种各样的错误

如:unable to access 'http://xxxx.git/': The requested URL returned error: 502

ssh: Could not resolve hostname xxxx: Name or service not known
fatal: Could not read from remote repository.总之各种报错各式各样。

在参考git解决ssh: Could not resolve hostname github: Name or service not known的问题_ould not resolve hostname gitlab-codelab-fff7cb94d-CSDN博客之后我用以下方法进行解决:

1.打开代码仓库.git文件夹中的config文件,里面可以看到你的远程仓库和各个分支的信息。远程仓库下有对应的url地址,把想要提交代码的url地址删去,改为:

https://github.com/用户名/项目名.git

gitlab也是同样,最简单的方法就是直接将你项目GitHub的网址复制下来,而gitlab删去www.即可

2.查看本机系统端口号:设置->网络和Internet->代理

3.设置git端口号和上面的端口号保持一致

  1. git config --global http.proxy 127.0.0.1:7890
  2. git config --global https.proxy 127.0.0.1:7890

最后拉取或者推送就可以了

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号