试图对git存储库进行简单的更改,私有托管与github。我克隆了存储库,进行了更改,然后将其推开审查。git push
没有成功,我以为我可能有胖子克隆存储库时远程URL(但是不能正确,因为我成功克隆了存储库,对吗?)。我尝试删除,重新添加遥控器,但推动仍然失败:
说明问题:
% git remote -v
origin https://github.com/our-organisation/some-repository.git (fetch)
origin https://github.com/our-organisation/some-repository.git (push)
% git fetch -v origin
From https://github.com/our-organisation/some-repository
= [up to date] MO_Adding_ECS_configs -> origin/MO_Adding_ECS_configs
= [up to date] update_gems -> origin/update_gems
% git push -v origin
Pushing to https://github.com/our-organisation/some-repository.git
remote: Repository not found.
fatal: repository 'https://github.com/our-organisation/some-repository.git/' not found
[某些名称可能已更改。]
当远程URL正确时,Github说"找不到存储库"?
在存储库上检查您的写入权限!
我的一些同事有益地建议我尝试一个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失败模式在这种情况下略微更好,我在ssh上使用https遥控器,因为github 推荐 https,
我知道,github在某些人中使用"未找到"的"未找到"防止无意中陶醉私人存在的情况存储库。这是网络上相当普遍的做法。
需要身份验证的请求将返回
404 Not Found
,而不是403 Forbidden
,在某些地方。这是为了防止意外泄漏 未经授权的用户的私人存储库。
- github
对我没有意义的是,当我使用github身份验证凭证助手和我可以访问该存储库(成功克隆并获取它)github会因为缺少而选择对我隐藏其存在写许可。
检查https://github.com/our-organisation/some-repository/使用Web浏览器确认我没有写入存储库的权限。我们的团队的GitHub管理员能够在简短的一小段时间,我能够将分支推到上。
希望这个问题&一个将来会帮助人们。