简体   繁体   中英

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. I even regenerated my ssh key and added it to 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:

$ 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. 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.

try this

git push origin master

read this documentation for more options with git push

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM