Git push requires username and password

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

    I just came across the same problem, and the simplest solution I found was to use SSH URL instead of HTTPS one:

    ssh://git@github.com/username/repo.git
    

    And not this:

    https://github.com/username/repo.git
    

    You can now validate with just the SSH key instead of the username and password.

提交回复
热议问题