Authentication failed Git Origin: Build & delivery Last updated 13 Oct 2026

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.

Exact message you may see Authentication failed forInvalid username or passwordHTTP Basic: Access denied
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 not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

401 — HTTP 401 Unauthorized (HTTP)401AADSTS50076 — Azure AD (Entra ID): AADSTS50076 / AADSTS50079 — multi-factor authentication required (Azure)AADSTS50076AADSTS50126 — AADSTS50126: Error validating credentials due to invalid username or password (Azure)AADSTS50126AADSTS700016 — Azure AD (Entra ID): AADSTS700016 Application not found in the directory (Azure)AADSTS700016ATS — App Transport Security has blocked a cleartext HTTP resource load (iOS)ATSauth/invalid-credential — Firebase Auth: auth/invalid-credential (auth/wrong-password, auth/user-not-found, auth/invalid-login-credentials) (Authentication)auth/invalid-credenti…bad auth : Authentication failed — MongoDB: MongoServerError: bad auth : Authentication failed (code 8000 / 18) (MongoDB)bad auth : Authentica…cannot rebase — error: cannot pull with rebase: You have unstaged changes. Please commit or stash them. (Git)cannot rebaseAuthentic…

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.