我有一个非常奇怪的问题与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
什么好主意吗?
当前回答
我也遇到过同样的问题,是私人回购。
做以下几点:
移除远端原点
git remote rm origin
重新添加原点,但与您的用户名和PWD与写权限在这个PVT回购
git remote add origin https://USERNAME:PASSWORD@github.com/username/reponame.git
其他回答
我也有同样的问题。
我解决了把我的gitlab用户名前缀到gitlab.com url的问题,就像这样: 之前: https://gitlab.com/my_gitlab_user/myrepo.git 后: https://my_gitlab_user@gitlab.com/my_gitlab_user/myrepo.git 在这种情况下,将再次要求凭据,这就完成了!
我得到了同样的错误,因为我改变了我的github用户名,然后我这样做:
git remote -v
然后:
git remote set-url newname newurl
git push -u origin master
这次我能够推送到存储库。 我希望这能有所帮助。
有类似的问题。问题的根源是我遵循了一些关于向Github添加新存储库的在线教程。
只要去Github,创建一个新的repo,它会要求你添加一个README,不要添加它。创建它,你会得到如何推送的指导。
它类似于接下来的两行:
git remote add origin https://github.com/YOUR_USER/your-repo.git
git push -u origin master
如果您包括您的用户名和回购名称,我们可以合理地帮助您,目前我们没有理由认为回购确实存在。
此外,如果回购是私有的,并且您无法访问它,github将返回“不存在”,以避免披露私有回购的存在。
编辑:如果你不能克隆它,因为它说它不存在,它是私有的,这是因为你没有发送身份验证。确保您的公钥已添加到密匙环,或暂时使用HTTP基本身份验证。
检查是否具有读写权限。
Git错误消息具有误导性。我也遇到过类似的问题。我被添加到一个现有的项目中。我克隆了它并提交了一个本地更改。我去推,得到了ERROR: Repository not found。错误消息。
将我添加到项目的人给了我对存储库的只读访问权。他们做出了改变,我得以推动。