为什么无法在终端中拉取github代码

为什么无法在终端中拉取github代码

现在我可以从 Google Chrome 浏览器访问 github.com,但无法在终端中提取代码:

[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/cruise-open% git pull
fatal: unable to access 'https://github.com/jiangxiaoqiang/cruise-open.git/': Connection timed out after 300016 milliseconds

当我 ping github.com 时,输出如下:

[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/cruise-open% ping github.com
PING github.com (13.250.177.223) 56(84) bytes of data.
64 bytes from ec2-13-250-177-223.ap-southeast-1.compute.amazonaws.com (13.250.177.223): icmp_seq=1 ttl=45 time=125 ms
64 bytes from ec2-13-250-177-223.ap-southeast-1.compute.amazonaws.com (13.250.177.223): icmp_seq=2 ttl=45 time=124 ms
64 bytes from ec2-13-250-177-223.ap-southeast-1.compute.amazonaws.com (13.250.177.223): icmp_seq=3 ttl=45 time=118 ms
64 bytes from ec2-13-250-177-223.ap-southeast-1.compute.amazonaws.com (13.250.177.223): icmp_seq=4 ttl=45 time=123 ms
64 bytes from ec2-13-250-177-223.ap-southeast-1.compute.amazonaws.com (13.250.177.223): icmp_seq=5 ttl=45 time=119 ms
64 bytes from ec2-13-250-177-223.ap-southeast-1.compute.amazonaws.com (13.250.177.223): icmp_seq=6 ttl=45 time=124 ms
64 bytes from ec2-13-250-177-223.ap-southeast-1.compute.amazonaws.com (13.250.177.223): icmp_seq=7 ttl=45 time=124 ms

我应该怎么做才能使 pull github 代码正常工作?我之前已经克隆了该存储库。是的,我的浏览器使用代理。但使用代理的终端也不起作用。我在终端中像这样切换代理:

alias proxy="export all_proxy=socks5://127.0.0.1:7890"

答案1

添加代理:

git config --global --add remote.origin.proxy "127.0.0.1:7890"

对我有用。

相关内容