fatal: Authentication failed for 'https://github.com/x/y.git/'
HTTPS authentication to the Git host failed — wrong or expired credentials, or a password used where a token is required.
Seen on:
Git
Meaning
GitHub, GitLab and Bitbucket require personal access tokens (or OAuth via a credential manager) instead of account passwords for HTTPS. Stored credentials may be outdated.
Common causes
- Account password used instead of a token
- Expired/revoked token
- Cached old credentials
- Token missing scopes
⚡ Quick fix
- Create a personal access token and use it as the password
- Clear cached credentials
- Use GitHub CLI: gh auth login
- Switch to SSH
Detailed fix by platform
Git
gh auth login && gh auth setup-git
How to diagnose
- Credential — Token or password?
- Cache — Which credential is stored?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026