gpt4 book ai didi

git - 无法连接到 git 远程存储库

转载 作者:IT王子 更新时间:2023-10-29 01:29:55 32 4
gpt4 key购买 nike

执行 git push -u origin master 后,我得到:

fatal: unable to access 'https://github.com/xxxx/xxxx.git': Failed to connect to 127.0.0.1 port 8087: Connection refused

当我尝试克隆其他存储库时,也发生了同样的错误。

8087端口好像不忙。会出什么问题?

编辑:当我从 git:// 而不是 https:// 克隆时,它工作得很好。

最佳答案

发生这种情况是因为在 git 中配置了代理。

因为它是 https 代理(而不是 http)git config http.proxygit config --global http.proxy 帮不上忙。

1 : 查看你的 git 配置

git config --global -l

如果您没有像 https_proxy=... 这样与 https 代理相关的东西,那么问题不在这里。

如果您有与 https 代理相关的内容,请将其从文件 ~/.gitconfig 中删除,然后重试

2 : 如果还是不行,取消设置环境变量

检查你的环境变量:

env|grep -i proxy  

你应该有一行或几行 https_proxy=...

一一取消设置:unset https_proxy(或 HTTPS_PROXY,具体取决于变量的名称)

3 : 再次检查环境变量

env|grep -i 代理

如果它什么也没显示,你应该是好的。

注意:此解决方案适用于 http 和 https 代理问题。只是变量名称从 https 更改为 http

关于git - 无法连接到 git 远程存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24543372/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com