GitHub Error Message - Permission denied (publickey)

后端 未结 30 2552
长发绾君心
长发绾君心 2020-11-22 04:23

Anybody seen this error and know what to do?

I\'m using the terminal, I\'m in the root, the GitHub repository exists and I don\'t know what to do now.



        
30条回答
  •  独厮守ぢ
    2020-11-22 05:10

    I was using github earlier for one of my php project. While using github, I was using ssh instead of https. I had my machine set up like that and every time I used to commit and push the code, it would ask me my rsa key password.

    After some days, I stopped working on the php project and forgot my rsa password. Recently, I started working on a java project and moved to bitbucket. Since, I had forgotten the password and there is no way to recover it I guess, I decided to use the https(recommended) protocol for the new project and got the same error asked in the question.

    How I solved it?

    1. Ran this command to tell my git to use https instead of ssh:

      git config --global url."https://".insteadOf git://
      
    2. Remove any remote if any

      git remote rm origin
      
    3. Redo everything from git init to git push and it works!

    PS: I also un-installed ssh from my machine during the debug process thinking that, removing it will fix the problem. Yes I know!! :)

提交回复
热议问题