简体   繁体   English

Repo在使用git时没有发现致命错误并且无法推送到github

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

I've checked stackoverflow a lot trying to figure out why I could be receiving this error because I do have a repo on github for what I am trying to push to.我已经检查了很多 stackoverflow 试图弄清楚为什么我会收到这个错误,因为我在 github 上确实有一个我想要推送的内容的仓库。 I even regenerated my ssh key and added it to github.我什至重新生成了我的 ssh 密钥并将其添加到 github。 I also see:我还看到:

Please make sure you have the correct access rights

and the repository exists.并且存储库存在。

When I try to add the repo remotely I see:当我尝试远程添加 repo 时,我看到:

$ 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

Then I get the error然后我得到错误

When I try当我尝试

ssh -T git@github.com

I see the correct username我看到正确的用户名

Not sure what else to try.不知道还有什么可以尝试的。

If you have already typed如果您已经输入

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

you can not type it again, because origin is exist now.你不能再次输入它,因为 origin 现在已经存在。 And it will respond它会回应

fatal: remote origin already exists.致命:远程源已经存在。

but the address which link to origin may wrong.但是链接到原点的地址可能是错误的。 Try to type尝试打字

$ git remote remove origin

and type并输入

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

again.再次。

Then type然后输入

$ git push origin master

If both the address and SSH key are correct, it may work.如果地址和 SSH 密钥都正确,它可能会起作用。

try this尝试这个

git push origin master

read this documentation for more options with git push阅读此文档以了解更多使用 git push 的选项

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Git 致命错误,尝试推送后未找到存储库 - Git fatal error, repo not found after trying to push Git Push失败:致命:无法访问与github.com有关的未知SSL协议错误:-9805 - Git Push failed: fatal: unable to access Unknown SSL protocol error in connection to github.com:-9805 Git,致命:无法访问“https://github.com/path/to/repo.git”:gnutls_handshake() 失败:pull 函数出错 - Git, fatal: unable to access 'https://github.com/path/to/repo.git': gnutls_handshake() failed: Error in the pull function 在 git 和 github 中添加文件时出现致命错误 - Fatal error in while adding files in git and github 尝试将本地git repo推送到GitHub时终端冻结 - Terminal freezing while trying to push local git repo to GitHub 推送到仓库失败(Git / GitHub) - Push to repo failed (Git/GitHub) 使用git bash下载lexandera / Aardwolf.git(Windows); 致命错误-无法连接到github.com - downloading lexandera/Aardwolf.git using git bash (Windows); fatal error - unable to connec to github.com 无法使用git commit推送到分叉的仓库和使用脚本推送 - Unable to push to forked repo using git commit and push using a script 在 Kube.netes pod 中使用 GitHub 检出操作时,git 推送失败并在大型存储库中出现 memory 错误 - git push fails with a memory error in a large repo when using GitHub checkout actions in a Kubernetes pod 无法使用 git 将更改推送到 github - unable to push changes to github using git
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM