Skip to content
Latchkey

Git "Password authentication is no longer supported" in CI

GitHub removed account-password authentication for Git over HTTPS. A pipeline still passing a password is rejected outright and must use a token instead.

What this error means

A clone or push over HTTPS fails with remote: Support for password authentication was removed. The same operation works once a token replaces the password.

git
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 for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/org/repo.git/'

Common causes

Account password used for HTTPS Git

A legacy script or stored credential still sends the GitHub account password, which is no longer accepted.

Cached old credentials

A credential helper cached a password that is now invalid.

How to fix it

Authenticate with a token

  1. Replace the password with a PAT, GitHub App token, or the Actions GITHUB_TOKEN.
  2. Use x-access-token as the username.
.github/workflows/ci.yml
git remote set-url origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/org/repo.git

Clear stale cached credentials

  1. Reset the credential helper so the old password is not reused.
Terminal
git config --global --unset credential.helper || true

How to prevent it

  • Switch all HTTPS Git auth to tokens (PAT, App, or the workflow GITHUB_TOKEN), and never store an account password in CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →