How to Delete GitHub Credentials on Windows 10 & 11

# How to Delete GitHub Credentials on Windows 10 & 11

If you’ve ever tried to push code to a personal repository on GitHub and been met with a `403` error, you’re not alone. The message typically looks something like this:

“`
fatal: unable to access ‘https://github.com/xxx/xxx.git/’: The requested URL returned error: 403
“`

This error is frustrating because it often appears even when your username and password seem correct. In most cases, the culprit is a stale or outdated credential cached somewhere in Windows. Git on Windows uses the **Git Credential Manager**, which stores authentication details in the operating system’s built-in Credential Manager. When that cached credential expires — for example, after you revoke a personal access token or change your GitHub password — Git keeps trying to use the old one, and GitHub rejects it with a `403`.

A lot of the advice online covers how to delete credentials on macOS or Linux, where you’d typically use the `git credential-osxkeychain` command or edit `~/.git-credentials`. Those steps don’t apply on Windows. This guide walks through the correct, Windows-specific method that works on both **Windows 10** and **Windows 11**.

## The Quick Fix: Clear Credentials via Windows Credential Manager

The fastest way to resolve a persistent `403` error is to delete the old GitHub credentials stored in Windows Credential Manager, then let Git prompt you for fresh authentication on your next push.

### Step 1: Open Credential Manager

1. Press **Win + R** on your keyboard to open the Run dialog.
2. Type the following command and press **Enter**:

“`
control keymgr.dll
“`

This launches the Windows Credential Manager directly. You can also reach it through the Control Panel (navigate to **User Accounts → Credential Manager**), but the Run command is quicker.

### Step 2: Switch to the Windows Credentials Tab

Once Credential Manager is open, you’ll see two tabs at the top:

– **Web Credentials**
– **Windows Credentials**

Click on **Windows Credentials**. This is where Git Credential Manager stores the authentication tokens it uses for services like GitHub.

### Step 3: Locate GitHub Entries

Scroll down to the **Generic Credentials** section. Look for any entries whose names contain **`github.com`** or **`git:https://github.com`**. Depending on your setup, you may find one or several of these entries — for example:

– `git:https://github.com`
– `github.com`
– `github.com/account`

Each of these represents a cached credential that Git may be using for authentication.

### Step 4: Delete the Stale Credentials

For every GitHub-related entry you find:

1. Click the entry to expand it.
2. Click **Remove** (or **Delete**, depending on your Windows version).
3. Confirm the deletion when prompted.

Make sure you clear **all** GitHub entries, not just the first one. Leaving a stale credential behind can cause the `403` error to persist.

### Step 5: Push Again

Open your terminal or Git Bash, navigate to your repository, and attempt your push again:

“`bash
git push origin main
“`

This time, Git Credential Manager should pop up a fresh authentication window. Sign in with your current credentials — ideally using a **personal access token (PAT)** or browser-based sign-in through GitHub. Once authenticated, the new credential is cached and subsequent pushes should work without interruption.

## Why Does This Happen?

GitHub changed its authentication policy in August 2021, deprecating password-based authentication for Git operations in favor of personal access tokens or SSH keys. If you recently:

– Rotated or revoked a personal access token
– Changed your GitHub password
– Reorganized repository permissions
– Enabled or updated two-factor authentication

…then the credential that Git cached previously is no longer valid. Git doesn’t always detect this automatically — it just keeps submitting the old token until GitHub returns a hard error. Deleting the cached entry forces Git to request a new one.

## Alternative Method: Use the Git Command Line

If you prefer to work from the terminal, you can also manage credentials through Git itself.

### Remove cached credentials for a specific URL

“`bash
git credential reject < **Recency note:** Windows updates, Git for Windows releases, and GitHub’s authentication policies all evolve. If the Credential Manager interface or Git Credential Manager behavior doesn’t match what’s described here, refer to the latest [GitHub documentation](https://docs.github.com) and the [Git Credential Manager project](https://github.com/git-ecosystem/git-credential-manager) for current details.