Skip to content

Fix: The requested URL returned error: 403

  • by
  • 2 min read

Github is one of the most important skills a developer should have. It’s quite the resource when it comes to quickly bootstrapping a project or sharing your code with fellow developers or the larger community. Regardless, as easy as Github is to learn, it does have a few drawbacks that might catch you off guard. 

In this article, we’re talking about the requested URL returned error: 403 issues, its causes and what you can do to fix the problem. 


What causes the requested URL returned error: 403?

The error can be triggered by a number of different causes. Some common factors include:

  • Incorrect Github credentials. 
  • The Git client requires a modified HTTPS URL. 
  • Incorrect repository configuration. 

Also read: How to create a Git repository? How to connect it to GitHub?


How to fix the requested URL returned error: 403?

Here are three fixes you can try out.

Check your Github credentials

The first thing you should do is check to see if your Github credentials are correct, especially your password. Since Github pushes are done over SSH, the client will log into your Github account before pushing the files to the target repository and hence, entering the right password becomes critical. 


Check your server address

Check to make sure that you’re connecting to the right server. Even if the server address or URL is right, any network firewalls you might have, such as the ones on corporate networks can restrict your connection. Make sure you are connecting to the right domain with the right port number and that your network traffic is actually getting through to the server. 


Use SSH to push files to the repository

If you’re using HTTPS to push your files, try using SSH instead. All you have to do is use the git remote set-url command with the right parameters as follows.

[email protected]:OWNER/REPOSITORY.git

Once the command has run, you’ll be switched to SSH from HTTPS and the error should go away provided you’ve entered the right credentials for your Github account. 

Also read: How to delete a repository and branch in GitHub?

nv-author-image

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: [email protected]

>