Git push requires username and password

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

    Update for HTTPS:

    GitHub has launched a new program for Windows that stores your credentials when you're using HTTPS:

    To use:

    • Download the program from here

    • Once you run the program, it will edit your .gitconfig file. Recheck if it edited the correct .gitconfig in case you have several of them. If it didn't edit the correct one, add the following to your .gitconfig

      [credential]
          helper = !'C:\\Path\\To\\Your\\Downloaded\\File\\git-credential-winstore.exe'
      

      NOTE the line break after [credential]. It is required.

    • Open up your command line client and try git push origin master once. If it asks you for a password, enter it and you're through. Password saved!

提交回复
热议问题