remote: Support for password authentication was removed — how to fix
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/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 'https://github.com/user/repo.git/'
Quick fix: Easiest: install the GitHub CLI and run gh auth login. Or create a personal access token (GitHub → Settings → Developer settings → Tokens) and paste it when Git asks for a password.
What it means
When Git asks for "Password" over HTTPS, GitHub only accepts a token, not the password you use on the website.
Fix 1: GitHub CLI (simplest)
gh auth login # choose GitHub.com → HTTPS → authenticate in the browser
gh auth setup-git # makes git use gh's credentials
Fix 2: personal access token
- GitHub → Settings → Developer settings → Personal access tokens.
- Create a fine-grained token limited to the repositories you need, with Contents: Read and write (add Workflows if you edit
.github/workflows). A classic token needs thereposcope. - Run your
git pushagain. Username: your GitHub username. Password: paste the token.
Save it so you're not asked every time:
git config --global credential.helper store # plain text in ~/.git-credentials
# better on macOS: osxkeychain; on Windows: Git Credential Manager (installed with Git for Windows)
Fix 3: switch to SSH
git remote set-url origin git@github.com:USER/REPO.git
You'll need an SSH key added to your account. See Permission denied (publickey).
An old password is cached
If Git doesn't ask and just fails, an old password is stored in your credential manager.
- macOS: open Keychain Access, search
github.com, delete the entry. - Windows: Control Panel → Credential Manager → Windows Credentials → remove
git:https://github.com. - Linux (store helper): edit or delete
~/.git-credentials.
Then push again and enter the token.
Last updated 2026-10-27.