Home › Git

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

  1. GitHub → Settings → Developer settings → Personal access tokens.
  2. 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 the repo scope.
  3. Run your git push again. 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.

Then push again and enter the token.

Last updated 2026-10-27.