> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 403 Forbidden'' error message when pushing to a GitHub repository

> Learn How To Fix A 403 Forbidden Error When Pushing to GitHub via HTTPS. Just Follow Our Easy Step-By-Step Help Guide!

This article discusses a problem that may occur when you try to push to a remote GitHub repository using HTTPS from a hosting.com server.

## Problem

When you try to push changes to a GitHub repository from a hosting.com 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
```

## Cause

There are a few possible causes for this problem:

* You typed an incorrect password. Make sure you are using the correct GitHub password for the account.

* The Git client on the hosting.com server requires a modified HTTPS URL to work correctly. If this is the cause, the password prompt does not even appear when you try to do a push operation.

## Resolution

If you are sure you are using the correct GitHub password, there are two ways to resolve the "403 Forbidden" problem:

### Method #1: Use SSH

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](https://help.github.com/articles/changing-a-remote-s-url).

### Method #2: Modify the HTTPS URL

Some hosting.com 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:

1. Log in to your hosting.com account [using SSH](/docs/using-ssh-secure-shell).

2. At the command prompt, change to the directory where the Git repository is located.

3. Type the following command:

   ```bash theme={null}
   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
   ```

4. You need to add your GitHub username to the *github.com* portion of the URL. To do this, type the following command, replacing the *github-username* and *github-repository* values with your own account information:

   ```bash theme={null}
   git remote set-url origin "https://github-username@github.com/github-username/github-repository-name.git"
   ```

5. To verify the new remote URL setting, type the following command:

   ```bash theme={null}
   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.

## Related articles

* [Using Git](/docs/using-git)

* [Configuring a Git client](/docs/configuring-a-git-client)
