尽管存在 Git https:// 存储库,但未找到它
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29558484/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git https:// repository not found though it exists
提问by user1783346
I have a private repo on github. It's location was changed.
我在 github 上有一个私人仓库。它的位置被改变了。
I tried changing the remote but I wasn't able to push anymore.
我尝试更换遥控器,但我无法再推动了。
ls-remote https://github.com/xxxxx/xxxxx.git
gave me this
给了我这个
remote: Repository not found.
fatal: repository 'https://github.com/xxxxx/xxxxx.git/' not found
远程:未找到存储库。
致命:未找到存储库“ https://github.com/xxxxx/xxxxx.git/”
- I checked the spelling and it was correct.
- I was able to open the url in the browser
- I have sufficient rights on the repo.
- I could clone every other repo by https
- I removed origin with
git remove origin https://github.com/xxxx/xxxxx.git - re-added it with
git add origin https://github.com/xxxxx/xxxxx.git - I did a
git remote set-url origin https://github.com/xxxxx/xxxxx.git
- 我检查了拼写,它是正确的。
- 我能够在浏览器中打开网址
- 我对回购有足够的权利。
- 我可以通过 https 克隆所有其他 repo
- 我用
git remove origin https://github.com/xxxx/xxxxx.git删除了原点 - 用
git add origin https://github.com/xxxxx/xxxxx.git重新添加它 - 我做了一个
git remote set-url origin https://github.com/xxxxx/xxxxx.git
I upgraded git from 1.9.5 to 2.2.1 to see if it would help
我将 git 从 1.9.5 升级到 2.2.1 看看它是否有帮助
After the upgrade I did a new ls-remote on the repository and it asked to accept a new certificate. I did.
升级后,我在存储库上做了一个新的 ls-remote,它要求接受新证书。我做到了。
This didn't remove the problem
这并没有消除问题
Doing a ls-remote on the SSH URLurl though works perfectly So I fixed the problem by adding the SSH URL as remote origin
虽然在SSH URLurl上执行 ls-remote工作完美所以我通过添加 SSH URL 作为远程源解决了这个问题
Why the https:// url is Not foundkeeps me puzzled. Anyone has any idea?
为什么找不到https:// url让我感到困惑。任何人有任何想法?
回答by kan
I think that as it is a private repo, it appears as non-existent for anonymous access. If you use https url, it sends anonymous request, while ssh url uses your ssh credentials and private key to establish connection.
我认为,因为它是一个私人回购,它似乎不存在匿名访问。如果您使用 https url,它会发送匿名请求,而 ssh url 使用您的 ssh 凭据和私钥来建立连接。
Not sure how to make it work properly with github, but try specifying a username in the url such as ls-remote https://[email protected]/xxxxx/xxxxx.git
.
不确定如何使其与 github 一起正常工作,但尝试在 url 中指定用户名,例如ls-remote https://[email protected]/xxxxx/xxxxx.git
.
Here some clues, I believe: Is there a way to skip password typing when using https:// on GitHub?
这里有一些线索,我相信:在 GitHub 上使用 https:// 时,有没有办法跳过密码输入?