我有一个非常奇怪的问题与git和github。当我试着推的时候,我得到:
git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
我添加了遥控器:
git remote add origin git@github.com:account-name/repo-name.git
什么好主意吗?
我有一个非常奇怪的问题与git和github。当我试着推的时候,我得到:
git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
我添加了遥控器:
git remote add origin git@github.com:account-name/repo-name.git
什么好主意吗?
当前回答
另外,一定要检查是否安装了桌面客户端。我仔细检查了一切,我的权限,SSH,但原来我在客户端列出的回购覆盖了我通过终端输入的。
其他回答
remote:未找到存储库。可能是一个令人沮丧的误导错误消息从github试图推到HTTPS远程,你没有写权限。
检查您对存储库的写权限!
尝试SSH远程到相同的存储库显示不同的响应:
% git remote add ssh git@github.com:our-organisation/some-repository.git
% git fetch ssh
From github.com:our-organisation/some-repository
* [new branch] MO_Adding_ECS_configs -> ssh/MO_Adding_ECS_configs
* [new branch] update_gems -> ssh/update_gems
% git push ssh
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
“正确的访问权限?”
那你为什么不早说?
此时值得注意的是,虽然SSH失败模式在此场景中 稍微好一点,我使用HTTPS远程超过SSH,因为 GitHub推荐HTTPS over SSH。
我知道GitHub使用“未找到”的意思是“禁止”在一些 环境防止不经意间泄露了一个私人的存在 存储库。
需要身份验证的请求将返回404 Not Found,而不是 在某些地方是禁止的。这是为了防止意外泄漏 未授权用户的私有存储库。
——GitHub
这在网络上是一种相当普遍的做法,实际上它是这样定义的:
404(未找到)状态代码表示未找到原始服务器 目标资源的当前表示形式或不愿意 揭露它的存在。
——6.5.4。404未找到,RFC 7231 HTTP/1.1语义和内容(重点挖掘)
对我来说毫无意义的是,当我使用一个GitHub认证 凭据助手 并且我可以访问该存储库(已经成功地克隆和获取 它),GitHub会选择隐藏它的存在对我因为失踪 写权限。
通过网络查看https://github.com/our-organisation/some-repository/ 浏览器确认我没有写存储库的权限。我们的 团队的GitHub管理员能够在短时间内授予我的团队写访问权 好不容易,我终于把树枝推了上去。
Normally it happens because the project is private and you have not rights to write it. I had the same "problem" a few times, and it was for that reason. If the project it is yours, just create a private and a public key following this link: https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent and add them to the "SSH and Key" section on gitHub, then you will be able to push to the repo. In the other hand if the project it is not your, ask the owner to give you the rights for it.
如果有人在github.com上遇到这个问题,检查你是否接受了回购所有者允许提交给你的邀请。直到你接受邀请,回购将是无形的为您。所以你会得到ERROR: Repository not found。
我也有同样的问题。试试下面的方法: 1. 修改密钥链访问在Mac的git凭证解决了我的问题。 2. 重置原始url
git remote rm origin
git remote add origin git@github.com:account-name/repo-name.git
我也遇到过类似的问题。错误的凭据缓存在OS X的密钥链中。
查看:https://help.github.com/articles/updating-credentials-from-the-osx-keychain