Git push requires username and password

前端 未结 24 2511
灰色年华
灰色年华 2020-11-22 04:14

I cloned a Git repository from my GitHub account to my PC.

I want to work with both my PC and laptop, but with one GitHub account.

When I try to push to or p

24条回答
  •  梦如初夏
    2020-11-22 04:52

    As many users has said, you just have to change your Git repository URL from HTTPS to SSH.

    If you haven't generated a SSH key in your machine, then your are going to have to do it.

    Just as an additional information, after doing this change I still was getting the same error:

    Permission Denied.

    In my case, the problem was that I was using the Windows Shell to execute the ngh command; since this command should open a prompt to request the SSH phrase and the Windows Shell doesn't open these kinds of prompts, the authentication just failed.

    So, I just had to open the Git shell and execute the ngh command there, put the SSH phrase in the prompt every time it asked for it and "voilà"... It just worked fine!

提交回复
热议问题