How to fix "Support for password authentication was removed" on GitHub
Researched, not yet tested: compiled from GitHub's announcement and docs as of 29 November 2026; the local Git commands were tested with Git 2.43, but we didn't push to GitHub with a password. Check the commands against your setup.
GitHub no longer accepts your account password for git push, pull or clone. The quickest fix is to sign in once with the GitHub CLI, which stores a token for Git:
gh auth login
Choose GitHub.com, pick HTTPS as the protocol, and answer yes when it asks to authenticate Git with your GitHub credentials. Then run your Git command again. You can also use a personal access token or switch the repository to SSH, covered below.
We didn’t push to GitHub with a password to reproduce this. The steps come from GitHub’s announcement and its docs on caching credentials. We tested the local Git commands (clearing a saved credential, changing the remote URL) with Git 2.43.
The error
As reported in the top Stack Overflow question about it:
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for ...
GitHub’s announcement says that from August 13, 2021 it no longer accepts account passwords when authenticating Git operations on GitHub.com. Accounts with two-factor authentication already needed a token or SSH.
Option 1: GitHub CLI (simplest)
GitHub’s docs recommend the GitHub CLI or Git Credential Manager for HTTPS. With the CLI installed (brew install gh on a Mac), run gh auth login, choose HTTPS and say yes to authenticating Git. It stores the credential, and later pushes don’t prompt.
Option 2: a personal access token
- On GitHub, open Settings > Developer settings > Personal access tokens and create a token. A fine-grained token can be limited to the repositories you need. It needs Contents set to read and write for pushing.
- Copy the token. GitHub only shows it once.
- Run your Git command. At the
Passwordprompt, paste the token instead of your password.
Set an expiry date you’ll remember. When it expires, the error comes back as a plain authentication failure.
Option 3: switch the repository to SSH
SSH uses a key on your computer instead of a token. If you have a key added to your GitHub account, change the remote:
git remote set-url origin git@github.com:USER/REPO.git
git remote -v
In our test, git config --get remote.origin.url showed the new git@github.com: address after set-url. To create and add a key, see how to generate an SSH key. If the push then fails with Permission denied (publickey), see that fix.
Remove an old saved password
If you’ve set up a token and still get the error, Git is probably sending a stored password. Ask Git to forget the GitHub credential:
printf 'protocol=https\nhost=github.com\n\n' | git credential reject
With Git’s store helper, our test credential (https://me:oldpassword@github.com) was removed from ~/.git-credentials and the file was left empty. The same command passes the request to whichever credential helper you use. On a Mac you can also delete the github.com entry of kind “internet password” in Keychain Access. On Windows, remove the git:https://github.com entry in Credential Manager. Then run your Git command and sign in again.
For other push errors, such as a rejected push after signing in, see push rejected (non-fast-forward).
FAQ
When did GitHub remove password authentication?
GitHub's announcement says it stopped accepting account passwords for authenticating Git operations on GitHub.com from August 13, 2021. It applies to command-line Git and to apps that send your password to GitHub. GitHub Desktop wasn't affected.
Where do I enter the personal access token?
In the same password prompt. When Git asks for a username, enter your GitHub username. When it asks for a password, paste the token instead of your account password. A credential helper then remembers it.
I already use a token and still get this error. Why?
Usually your computer is still sending an old saved password, or the token expired. Remove the stored GitHub credential (see the steps on this page) and sign in again. Also check the token hasn't passed its expiry date and has access to the repository.
