VS2019 Github问题

同一台机器,VS2015连github push和pull都没问题,VS2019却连不上,很诡异。后来通过下面方法解决。

1、Github域名无法解析
解决方案:
首先通过网址https://github.com.ipaddress.com/www.github.com查看当前github.com对应的IP地址,然后在C:\Windows\System32\drivers\etc\HOSTS中加入如下一行:

140.82.113.4 github.com
最后打开cmd,执行下面命令即可:
ipconfig /flushdns

2、Github域名问题解决后,连接仍然超时
解决方案:
如果在局域网,可能需要设置全局http.proxy,查看proxy和设置proxy的命令如下:

git config --global --get http.proxy    #查看proxy
git config --global http.proxy http://x.x.x.x:8080

通过以上两个步骤,VS2019连github各种操作正常了。

猜你喜欢

转载自blog.csdn.net/bodybo/article/details/116103053