GitHub: Permission denied (publickey). fatal: The remote end hung up unexpectedly

前端 未结 23 1554
情深已故
情深已故 2020-11-28 01:09

I have followed these instructions below to upload a project.

Global setup:

 Download and install Git
  git config --global user.name \"Your Name\"
         


        
相关标签:
23条回答
  • 2020-11-28 01:57

    In my case, I had to setup the public key for another user, as I already had one for my main user. once I switched users and performed the commands in the link above I was able to perform the setup for my test server without a problem.

    0 讨论(0)
  • 2020-11-28 01:59

    after you created the RSA key pair, you must to add it to SSH using:

    ssh-add ~/.ssh/id_rsa
    

    or wherever you created your rsa key pair.

    0 讨论(0)
  • 2020-11-28 01:59

    I had this problem, but none of the solutions above worked. I could clone and fetch but couldn't push. Eventually, I figured out the problem was in the url in my .git/config, it should be:

    git@github.com:<username>/<project>
    

    (not ssh://github.com/<username>/<project>.git or https://github.com/<username>/<project>.git).

    0 讨论(0)
  • 2020-11-28 01:59

    A good one if you have installed git on your computer:

    http://help.github.com/mac-set-up-git/

    0 讨论(0)
  • 2020-11-28 01:59

    You can try change your type connection to branch from ssh to https.

    1. nano project_path/.git/config
    2. Replace git@github.com:username/repository.git to https://username@github.com/username/repository_name.git
    3. Save file ctrl + o

    After that you can try git pull without publickey

    0 讨论(0)
提交回复
热议问题