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

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


I just got the same problem and just figured out what's cause.

Github seems only supports ssh way to read&write the repo, although https way also displayed 'Read&Write'.

So you need to change your repo config on your PC to ssh way:

  1. edit .git/config file under your repo directory
  2. find url=entry under section [remote "origin"]
  3. change it from url=https://MichaelDrogalis@github.com/derekerdmann/lunch_call.git to url=git@github.com/derekerdmann/lunch_call.git. that is, change all the texts before @ symbol to ssh://git
  4. Save config file and quit. now you could use git push origin master to sync your repo on GitHub


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.


One small addition to Sean's answer.

Instead of editing .git/config file manually, you can use git remote set-url command.

In your case it should be:

git remote set-url origin ssh://git@github.com/derekerdmann/lunch_call.git

I find it easier and cleaner, than messing around with dot-files.