远程:找不到存储库。在我的GitHub上。

3

操作系统: Windows10
git版本: 2.23.0.windows.1

几个月前我 fork 了一个仓库,一切都运行良好。我需要重置我的 windows,现在每当我尝试使用 git clone' https://github.com/user_name/repo_name.git' 克隆fork的仓库时。

它给了我一个错误信息 remote: Repository not found. fatal: repository 'https://github.com/user_name/repo_name.git/' not found

运行 git config --list ,我的所有认证信息都是正确的,可能是什么原因呢?

按照 @VonC 的建议
首先,我尝试了git clone https://github.com/user_name/repo

它输出了 fatal: unable to access 'https://github.com/user_name/repo/': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

其次,我可以通过插入https://github.com/user_name/repo 来成功访问 repo。

第三,运行 git config --global http.sslBackend "openssl" 然后尝试克隆 git 仍然显示相同的repo not found

第四,运行 git config -l ,我得到了 http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt

现在运行git config --system http.sslcainfo "C:\Program Files\Git\mingw64\ssl\certs\curl-ca-bundle.crt",这应该可以解决问题,但是它给出了错误信息:

error: could not lock config file C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied

1个回答

1
首先,尝试使用git clone https://github.com/user_name/repo_name(不用引号,没有最终的.git/)。
其次,请仔细检查您的URL的大小写,尝试在浏览器中转到git clone https://github.com/user_name/repo_name以查看它是否可见/可访问。
请注意,git config仅包括user.name/user.email,这些不是凭据(仅用于创建新提交时的作者设置)。只有您的存储库是私有的才会涉及凭证。
关于OpenSSL错误消息,请检查git config --global http.sslBackend "openssl"是否有所帮助,参考desktop/desktop issue 3326。确保您的证书(包含在Git For Windows中)也被引用(如此处所示)。
git config --system http.sslcainfo "C:\Program Files (x86)\git\bin\curl-ca-bundle.crt"

根据您自己的Git安装文件夹调整路径。


但是为什么会发生这种情况呢?我是直接从 GitHub 的克隆或下载绿色按钮复制的 URL。 - chaikov
你使用的是哪个操作系统?Git 的版本是多少?这是一个私有代码库吗? - VonC
是的,我可能不小心在末尾添加了'/'。我已经fork了私有repo,但是当我查看设置时,我可以看到这个repo的SSH。 - chaikov
git config -l 命令是否包含 http.sslcainfo=/ssl/certs/ca-bundle.crt - VonC
是的,它是不同的路径,但使用正确的路径运行它仍然会给我相同的错误。 - chaikov
显示剩余2条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接