使用 github.com.cnpmjs.org 时 git push 报错: Connection refused

1. 出现的问题

为了加快 git clone 的速度,使用了 github.com.cnpmjs.org 这个镜像网站。

然而当我们执行 git push 命令的时候,发现 push 不上去了,这时候报的错误信息为

fatal: unable to access ‘https://github.com.cnpmjs.org/sshpark/xxx.git/’: Failed to connect to github.com.cnpmjs.org port 443: Connection refused

2. 解决措施

首先执行

git config --list --show-origin

可以看到我们的git配置信息有这么一项,

......
file:.git/config        remote.origin.url=https://github.com.cnpmjs.org/sshpark/xxx.git
......

然后只需要将 remote.origin.url=https://github.com.cnpmjs.org/sshpark/xxx.git 改为 remote.origin.url=https://github.com/sshpark/xxx.git 就可以了。


版权声明:本文为qq_33567644原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。