我有一个非常奇怪的问题与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检查你有写访问权。

我也有同样的问题。

我解决了把我的gitlab用户名前缀到gitlab.com url的问题,就像这样: 之前: https://gitlab.com/my_gitlab_user/myrepo.git 后: https://my_gitlab_user@gitlab.com/my_gitlab_user/myrepo.git 在这种情况下,将再次要求凭据,这就完成了!

我的一个Github库也有同样的问题。

方法:

使用SSH而不是HTTPS,然后推/拉开始工作正常。

步骤1:

从HTTPS复制链接

步骤2:

在本地存储库中

git remote rm origin

步骤3:

在复制的url中将github.com替换为username.password@github.com

步骤4:

git remote add origin url

我有这个问题,意识到我使用的是一个不同的帐户,其回购是。以原始用户身份登录解决了该问题。