Github HTTPS push 403 error

I am able to clone repos just fine using https:

$ git clone

but when I go to push commits it gives me this error:

$ git push error: The requested URL returned error: 403 Forbidden while accessing

It’s probably something really simple, but any help would be appreciated.



Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

try changing your remote server name from to by following command:

$ git remote set-url origin

and then push

If the above steps doesn’t work, check whether there is port blocked. Ask your firewall team to open the same.

Check out <a href=“”></a>. <br>I recommend pushing via SSH instead as using HTTPS requires you to enter your credentials each time you push. You can do that by generating SSH keys if you haven’t already: <pre>ssh-keygen -t rsa -b 2048 -N “”</pre> and adding the public key to your Github account: <pre>cat ~/.ssh/</pre>