This article discusses a problem that may occur when you try to push to a remote GitHub repository using HTTPS from an A2 Hosting server.
When you try to push changes to a GitHub repository from an A2 Hosting server using an HTTPS URL, you receive the following error message:
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/github-username/github-repository-name.git/info/refs
There are a few possible causes for this problem:
If you are sure you are using the correct GitHub password, there are two ways to resolve the “403 Forbidden” problem:
Instead of using HTTPS URLs to push changes to GitHub, you can use SSH instead. For information about how to do this, please visit https://help.github.com/articles/changing-a-remote-s-url.
Some A2 Hosting managed servers have an old version of the Git client installed. To push changes to GitHub using this older client version, you must include your GitHub username in the HTTPS URL.
To do this, follow these steps:
git config -l | grep url
You should see output that resembles the following:
remote.origin.url=https://github.com/github-username/github-repository-name.git
You need to add your GitHub username to the github.com portion of the URL. To do this, type the following command, replacing the values in red with your own account information:
git remote set-url origin "https://github-username@github.com/github-username/github-repository-name.git"
To verify the new remote URL setting, type the following command:
git config -l | grep url
Now when you try to push changes to the GitHub repository, you are prompted for a password, and the push operation should succeed.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.