Question:
I was able to clone a copy of this repo over HTTPS authenticated. I’ve made some commits and want to push them back out to the GitHub server but getting below error.
1 2 3 4 5 6 |
>git push Password: error: The requested URL returned error: 403 while accessing https://MichaelDrog alis@github.com/derekerdmann/lunch_call.git/info/refs fatal: HTTP request failed |
Answer:
To definitely be able to login using https
protocol, you should first set your authentication credential to the git Remote URI:
1 2 |
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:
1 2 |
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.