Git "Password authentication is no longer supported" in CI
By Daniel Zoghalchali·Latchkey
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/'
Diagnose it: depth, refs, or credentials?
Terminal
git rev-parse --is-shallow-repository
git rev-parse --abbrev-ref HEAD # prints HEAD when detached
git log --oneline -3
git remote -v
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.
Switch all HTTPS Git auth to tokens (PAT, App, or the workflow GITHUB_TOKEN), and never store an account password in CI.
Frequently asked questions
What causes Git "Password authentication is no longer supported" in CI?
There are 2 common causes: account password used for https git and cached old credentials. A legacy script or stored credential still sends the GitHub account password, which is no longer accepted.
How do I fix Git "Password authentication is no longer supported" in CI?
There are 2 fixes depending on which cause you have: authenticate with a token and clear stale cached credentials. Work through them in order, since the first is the most common.
What does Git "Password authentication is no longer supported" in CI actually mean?
A clone or push over HTTPS fails with remote: Support for password authentication was removed.
How do I stop Git "Password authentication is no longer supported" in CI happening again?
Switch all HTTPS Git auth to tokens (PAT, App, or the workflow GITHUB_TOKEN), and never store an account password in CI.