// troubleshooting guide · azure devops
Azure DevOps Git Authentication Failed (PAT Not Working)
- Status
- Ongoing
- platforms:
- Windows, Mac, Linux
- updated:
- November 16, 2026
- reports:
- 4
- Method
- how we research
RUNBOOK · azure-devops/git-authentication-failed4 FIXES
// quick answer
Git rejects your credentials when the PAT expired, lacks Code (Read & write) scope, belongs to another org, or a stale cached credential is used. Create a fresh org-scoped PAT, clear the cached credential, or use Git Credential Manager.
Most likely fix: Create a new PAT with the right scope
How to fix it
// try these in order, the most common fix is first
FIX 1Create a new PAT with the right scope
- 01User settings (top right) > Personal access tokens > New Token
- 02Pick the correct organization and Code: Read & write
- 03Use any username and the PAT as the password when git prompts
Did this fix it?FIX 2Clear cached credentials
- 01Windows: Credential Manager > Windows Credentials > remove git:https://dev.azure.com entries
- 02macOS: Keychain Access > search dev.azure.com > delete
- 03Retry the git command and enter the new credentials
Did this fix it?FIX 3Use Git Credential Manager
- 01Install or update Git Credential Manager (bundled with Git for Windows)
- 02Run git clone again and sign in through the browser window with the account that has access
- 03Sign out of other Microsoft accounts if the wrong one is picked
Did this fix it?FIX 4Send the PAT as a header in scripts
- 01Base64-encode ':<PAT>'
- 02Run git -c http.extraHeader="Authorization: Basic <base64>" clone <url>
- 03Prefer this over putting the token in the URL username
Did this fix it?
Symptoms
git clone, pull or push to dev.azure.com fails with 'fatal: Authentication failed' or HTTP 401, or keeps prompting for a password.
Why it happens
- C-01The personal access token expired or was revoked (leaked PATs are revoked automatically)
- C-02The PAT is scoped to a different organization or lacks Code scope
- C-03An old credential is cached in the OS credential store
- C-04Several Microsoft accounts signed in, so the wrong one is used
- C-05The PAT is embedded in the URL in a way Azure DevOps doesn't accept
// this guide also covers
- azure devops git authentication failed
- azure devops pat not working
- azure repos clone 401
Still not working?
If Azure DevOps keeps failing, you're not alone. See every Azure DevOps problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usOther Azure DevOps errors
- Azure DevOps No Hosted Parallelism Has Been Purchased or Granted
- Azure DevOps Pipeline Stuck in Queue (Waiting for an Available Agent)
- Azure DevOps Pipeline Not Triggering on Push
- Azure DevOps TF401027: You Need the Git 'GenericContribute' Permission
- Azure Pipelines Job Canceled After 60 Minutes
- Azure Artifacts Feed 401 Unauthorized (Unable to Load the Service Index)
- Azure DevOps Service Connection 'Failed to Obtain the JSON Web Token'
- Why Is Azure DevOps Boards So Slow?