Authentication failed 🌿 Git

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

  1. Create a personal access token and use it as the password
  2. Clear cached credentials
  3. Use GitHub CLI: gh auth login
  4. Switch to SSH

Detailed fix by platform

Git

  1. gh auth login && gh auth setup-git

How to diagnose

  1. Credential — Token or password?
  2. 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.