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

什么好主意吗?


当前回答

我在一台MAC上遇到了同样的问题,试图从我以前连接到的一个私人回购中提取。

我通过在回购url中包含我的用户名来解决这个问题:

git remote set-url origin https://<YOUR_USER_NAME_HERE>@github.com/<YOUR_USER_NAME_HERE>/<REPO>.git

然后我从回购中提取了数据。

对于一个你想克隆的新回购:

git clone https://<YOUR_USER_NAME_HERE>@github.com/<YOUR_USER_NAME_HERE>/<REPO>.git    

它会提示你输入那个账户的密码,然后你就可以去了。

其他回答

问题:由于某些原因,Github不熟悉你的存储库。

Error:在git cli中提示如下:

remote:未找到存储库。致命:库 “https://github.com/MyOrganization/projectName.git/”未找到

解决方案:2个选项

Github might not familiar with your credentials: - The first Option is to clone the project with the right credentials user:password in case you forgot this Or generate ssh token and adjust this key in your Github. aka git push https://<userName>:<password>@github.com/Company/repositoryName.git Repo Permissions Issue with some users - In my Use case, I solved this issue when I realized I don't have the right collaborator permissions on Github in my private repo. Users could clone the project but not perform any actions on origin. In order to solve this:

去Github上的仓库->设置->合作者和团队->添加 成员/维护你的用户->现在他们获得了提交的权限 ,推动

我的问题是我创建了一个没有权限的个人开发人员令牌

都经历过同样的问题。几年来一切都很正常,然后突然出现了这个错误。

问题是,我在用户的github SSH密钥(我总是用来访问有问题的回购)之前向我的SSH代理添加了另一个回购的部署密钥。SSH代理首先尝试了另一个回购的部署键,而GitHub出于一些完全无法解释的原因说

ERROR: Repository not found.

一旦我从SSH代理中删除了部署键,一切就恢复正常了。

在使用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帐户添加为存储库中的合作者之一。之后我就可以克隆这个项目了。

这对我来说很管用:

1. 的遥控器

$ git remote rm origin
$ git remote add origin git@github.com:<USER>/<REPO>.git

如果您的SSH密钥已经在另一个github代表上使用,您可以生成一个新密钥。

2. 生成新的SSH密钥

$ ssh-keygen -t rsa -b 4096 -C "web@github.com"

3.在SSH代理级别添加密钥

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa_github

4. 将新密钥添加到Github回购。