我有一个非常奇怪的问题与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

什么好主意吗?


当前回答

在使用MacBook Pro时遇到了同样的问题。

当我尝试克隆一个存储库时,我得到以下错误:

git clone https://github.com/mytech/mytech_frontend.git

Cloning into 'mytech_frontend'...
remote: Repository not found.
fatal: repository 'https://github.com/mytech/mytech_frontend.git/' not found

以下是我的解决方法:

问题是我已经在我的电脑上设置了我的个人GitHub帐户,我试图克隆的存储库是个人的私人存储库(而不是团队帐户)。

我所要做的就是通过进入项目设置,将我的个人Github帐户添加为存储库中的合作者之一。之后我就可以克隆这个项目了。

其他回答

我得到这个错误(但之前正在工作)。我的问题是缺少与Github帐户绑定的ssh密钥。您可以使用ssh-add -l检查当前的ssh密钥。

如果你的钥匙丢失了,你可以用

ssh-add ~/.ssh/your_key

这是如何解决我的问题

#check current github account
ssh -T git@github.com

#ensure the correct ssh key used with github
ssh-agent -s
ssh-add ~/.ssh/YOUR-GITHUB-KEY

#re-add the origin
git remote add origin git@github.com:YOUR-USER/YOUR-REPO.GIT
git push -u origin master

检查是否具有读写权限。

Git错误消息具有误导性。我也遇到过类似的问题。我被添加到一个现有的项目中。我克隆了它并提交了一个本地更改。我去推,得到了ERROR: Repository not found。错误消息。

将我添加到项目的人给了我对存储库的只读访问权。他们做出了改变,我得以推动。

如果使用私有存储库检查连接用户,则该用户必须具有使用存储库的权限。

只需使用SSH远程url,而不是HTTPS