使用 git 且无法推送到 github 时,回购未发现致命错误

Repo not found fatal error while using git and unable to push to github

我检查了 Whosebug 很多次,试图弄清楚为什么我会收到这个错误,因为我在 github 上确实有一个关于我要推送的内容的回购协议。我什至重新生成了我的 ssh 密钥并将其添加到 github。我也看到了:

Please make sure you have the correct access rights

并且存储库存在。

当我尝试远程添加存储库时,我看到:

$ git remote add origin git@github.com:<username>/<reponame>.git
> fatal: remote origin already exists.

$ git push

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin master

然后我得到错误

当我尝试时

ssh -T git@github.com

我看到了正确的用户名

不确定还可以尝试什么。

试试这个

git push origin master

阅读此文档以了解更多使用 git push

的选项

https://git-scm.com/docs/git-push

如果您已经输入

$ git remote add origin git@github.com:<username>/<reponame>.git

不能再输入了,因为origin已经存在了。 它会响应

fatal: remote origin already exists.

但是link到原点的地址可能是错误的。 尝试输入

$ git remote remove origin

并输入

$ git remote add origin git@github.com:<username>/<reponame>.git

再次。

然后输入

$ git push origin master

如果地址和 SSH 密钥都正确,它可能会起作用。