0

I created a repository on my local machine. I tried to push it to github git push origin master I added the remote repository. git remote add origin git@github.com:.... .git But when I push to the repository it gives an error

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Error Message screenshot

  • I removed all the ssh keys from github
  • This is a private repository
  • I removed all the ssh keys from github – aalizwel23 Aug 12 '18 at 16:58
3

You're trying to push via ssh. Missing pub key on the remote or missing private key in the ~/.ssh dir will result in an error. Try using the https protocol. git remote add origin https://github.com/{username}/{repo}.git, then push as usual. Good luck! :)

|improve this answer|||||
  • 1
    didn't see you already answered yout question. :D Glad u figured it out. – Атанас Минков Aug 12 '18 at 17:47
  • 2
    @Vinay666 Upvoting a question means “This question shows research effort; it is useful and clear”. I'm not sure which of these attributes applies to yours. However. Talking someone into upvoting a question isn't considered best practice here, especially if you neither upvoted the answer yourself nor accepted it. – PerlDuck Aug 12 '18 at 18:01
  • I figured it out myself and I posted the answer but it says "you can accept your answer in 2 days" imgur.com/a/rSrexHD – aalizwel23 Aug 13 '18 at 4:30
0

The thing is I am behind our institute proxy server(HTTP proxy server - IIT KGP). Which does not allow git protocol.I changed git remote add origin git@github.com:.... .git to git remote https://github.com/......git and it worked.Thanks to our institute proxy I am able to post a question and answer on ask ubuntu.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.