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

什么好主意吗?


当前回答

我也有同样的问题。试试下面的方法: 1. 修改密钥链访问在Mac的git凭证解决了我的问题。 2. 重置原始url

git remote rm origin
git remote add origin git@github.com:account-name/repo-name.git

其他回答

在我的情况下,这是因为我在另一个GitHub帐户也添加了相同的SSH密钥。检查和修复步骤

检查它:ssh -T git@github.com。如果显示了正确的用户名,那么问题就不同了。如果是另一个帐户,则执行步骤2。 简单地去另一个帐户,并删除ssh密钥从那里。 不同的帐户使用不同的密钥。Github把它们搞混了。

问题:由于某些原因,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上的仓库->设置->合作者和团队->添加 成员/维护你的用户->现在他们获得了提交的权限 ,推动

你必须生成SSH密钥,并在设置中添加到你的github帐户中 转到你的项目,在那里你克隆里面运行这些命令

1-ssh keygen -t rsa -b 4096 -C "rajankumar148@gmail.com"

在命令之后,你会得到一些选项,路径和名称可以留空,你可以输入密码。

2-eval $(ssh-agent -s)。

3-ssh-add ~ / . ssh / id_rsa

在这个命令之后,您必须输入与第一个命令中创建的相同的密码

之后,你可以检查你的默认主目录或任何目录,它在终端上显示。pub文件打开并复制密钥和过去在github设置新的SSH

如果有人在github.com上遇到这个问题,检查你是否接受了回购所有者允许提交给你的邀请。直到你接受邀请,回购将是无形的为您。所以你会得到ERROR: Repository not found。

我也遇到过类似的问题。错误的凭据缓存在OS X的密钥链中。

查看:https://help.github.com/articles/updating-credentials-from-the-osx-keychain