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
- Replace the password with a PAT, GitHub App token, or the Actions GITHUB_TOKEN.
- 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.gitClear stale cached credentials
- Reset the credential helper so the old password is not reused.
Terminal
git config --global --unset credential.helper || trueHow 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
Git "Authentication failed" for HTTPS PAT in CIFix the Git "fatal: Authentication failed" error for HTTPS in CI, caused by an invalid, expired, or insuffici…
Git GITHUB_TOKEN "permission to ... denied" on push in CIFix the GitHub Actions "Permission to org/repo.git denied to github-actions[bot]" push error, caused by the d…
Git "could not read Username" with no terminal in CIFix the Git "could not read Username ... No such device or address" error in CI, caused by Git prompting for…