fatal: Authentication failed for 'https://github.com/user/repo.git/'
Most likely cause: GitHub no longer accepts account passwords over HTTPS; a personal access token is required instead
Try first: Check what credential Git is currently using (git config --list | grep credential)
Likely causes
- GitHub no longer accepts account passwords over HTTPS; a personal access token is required insteadmost likely
- The stored credential is outdated, revoked, or typed incorrectlypossible
- Two-factor authentication is enabled but the plain password was suppliedpossible
How to fix it
Check what credential Git is currently usingSafe
Run the command below to see the stored username and token for this repository.
git config --list | grep credentialCreate or replace the HTTPS credential with a GitHub tokenChanges settings
Generate a new personal access token on GitHub (Settings > Developer settings > Personal access tokens) with repo scope, then run the command below and paste the token when asked for password.
git credential-manager erase https://github.com && git push⚠ This removes the old credential; make sure you have the new token ready.
Switch the remote URL to SSH if token problems continueChanges settings
Change the repository address to an SSH URL so Git uses your SSH key instead of a token.
git remote set-url origin git@github.com:user/repo.git
If that didn't fix it
Run 'git remote -v' and share the exact output along with the full command that produced the error.
When to see a technician
Get help if you cannot create a GitHub token or if corporate network policies block HTTPS authentication.
Quick answers
- What does fatal: Authentication failed for 'https://github.com/user/repo.git/' mean?
- Git cannot log in to the remote repository on GitHub when using an HTTPS URL. This usually happens because the stored username and password (or token) are wrong, expired, or not accepted by GitHub.
- What causes fatal: Authentication failed for 'https://github.com/user/repo.git/'?
- GitHub no longer accepts account passwords over HTTPS; a personal access token is required instead. (most likely) The stored credential is outdated, revoked, or typed incorrectly. (possible) Two-factor authentication is enabled but the plain password was supplied. (possible)
- How do I fix fatal: Authentication failed for 'https://github.com/user/repo.git/'?
- Try these in order, safest first: 1. Check what credential Git is currently using. 2. Create or replace the HTTPS credential with a GitHub token. 3. Switch the remote URL to SSH if token problems continue.
- What if that didn't fix it?
- Run 'git remote -v' and share the exact output along with the full command that produced the error.
- When should I see a technician?
- Get help if you cannot create a GitHub token or if corporate network policies block HTTPS authentication.