Pushing to Git returning Error Code 403 fatal: HTTP request failed

后端 未结 30 1255
轻奢々
轻奢々 2020-11-22 04:52

I was able to clone a copy of this repo over HTTPS authenticated. I\'ve made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7 x64.

30条回答
  •  心在旅途
    2020-11-22 05:01

    To definitely be able to login using https protocol, you should first set your authentication credential to the git Remote URI:

    git remote set-url origin https://yourusername@github.com/user/repo.git
    

    Then you'll be asked for a password when trying to git push.

    In fact, this is on the http authentication format. You could set a password too:

    https://youruser:password@github.com/user/repo.git
    

    You should be aware that if you do this, your github password will be stored in plaintext in your .git directory, which is obviously undesirable.

提交回复
热议问题