Git push requires username and password

前端 未结 24 2685
灰色年华
灰色年华 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:33

    You basically have two options.

    If you use the same user on both machines you need to copy the .pub key to your PC, so GitHub knows that you are the same user.

    If you have created a new .pub file for your PC and want to treat the machines as different users, you need to register the new .pub file on the GitHub website.

    If this still doesn't work it might be because ssh is not configured correctly and that ssh fail to find the location of your keys. Try

    ssh -vv username@github.com
    

    To get more information why SSH fails.

提交回复
热议问题