// 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
Share

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

  1. FIX 1Create a new PAT with the right scope

    1. 01User settings (top right) > Personal access tokens > New Token
    2. 02Pick the correct organization and Code: Read & write
    3. 03Use any username and the PAT as the password when git prompts
    Did this fix it?
  2. FIX 2Clear cached credentials

    1. 01Windows: Credential Manager > Windows Credentials > remove git:https://dev.azure.com entries
    2. 02macOS: Keychain Access > search dev.azure.com > delete
    3. 03Retry the git command and enter the new credentials
    Did this fix it?
  3. FIX 3Use Git Credential Manager

    1. 01Install or update Git Credential Manager (bundled with Git for Windows)
    2. 02Run git clone again and sign in through the browser window with the account that has access
    3. 03Sign out of other Microsoft accounts if the wrong one is picked
    Did this fix it?
  4. FIX 4Send the PAT as a header in scripts

    1. 01Base64-encode ':<PAT>'
    2. 02Run git -c http.extraHeader="Authorization: Basic <base64>" clone <url>
    3. 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 us

Watch Azure DevOps Get an email when its price changes, it has an outage, or we publish a new fix. No spam.

Fixed it? Share this guide

Other Azure DevOps errors

All 12 Azure DevOps errors and fixes →