remote: HTTP Basic: Access denied (GitLab) Git Origin: Build & delivery OSI layer 7 · Application Last updated 25 Nov 2026

remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled

GitLab rejected your HTTPS login.

Exact message you may see remote: HTTP Basic: Access deniedThe provided password or token is incorrect or your account has 2FA enabledGitLab HTTP Basic Access denied
Seen on: Git

Meaning

With 2FA you must use a personal access token as the password. Check token scopes (write_repository) and expiry.

Common causes

  • 2FA enabled
  • Token expired or missing scope
  • Wrong username

⚡ Quick fix

  1. Create a PAT with write_repository
  2. Use the token as password
  3. Update the stored credential

Detailed fix by platform

Git

  1. git remote set-url origin https://oauth2:$TOKEN@gitlab.com/org/repo.git

How to diagnose

  1. 2FA — on?
  2. Token — scope?
  3. Username — right?

🔧 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):

APNs: 410 Unregistered / DeviceTokenNotForTopic — {"reason":"Unregistered","timestamp":1700000000} (iOS)APNs: 410 Unregistere…APNs: BadDeviceToken (400) — {"reason":"BadDeviceToken"} HTTP/2 400 from api.push.apple.com (iOS)APNs: BadDeviceToken …APNs: InvalidProviderToken (403) — {"reason":"InvalidProviderToken"} HTTP/2 403 (iOS)APNs: InvalidProvider…Bitbucket: Authentication failed (app password / token) — remote: You may not have access to this repository or it no longer exists in this workspace (Git)Bitbucket: Authentica…fatal: could not read Username: terminal prompts disabled — fatal: could not read Username for 'https://github.com': terminal prompts disabled (Git)fatal: could not read…gh: HTTP 401: Bad credentials — gh: Bad credentials (HTTP 401) / error validating token: HTTP 401 (Git)gh: HTTP 401: Bad cre…Git keeps using an old password (macOS Keychain / Windows Credential Manager) — remote: Invalid username or password (cached credentials) (Git)Git keeps using an ol…git: 'credential-manager' is not a git command — git: 'credential-manager-core' is not a git command. See 'git --help'. (Git)git: 'credential-mana…remote: H…

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.