Azure DevOps: "TF401175: The version descriptor <Branch: … > could not be resolved to a version in the repository …"
TF401175 means the repository has no branch (or tag) with exactly the name between <Branch: and >. The server prints the name as it received it, then one space, then >, so read it character by character: a refs/heads/ in front, a different case, a trailing space or a %23 where a # was meant all show there. The end of the message names the repository it looked in.
The whole answer
Tested on October 30, 2026 on dev.azure.com, against a public repository with no sign-in, by reading a file from a branch that is not there:
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repository}/items
?path=/README.md&versionDescriptor.version=no-such-branch&versionDescriptor.versionType=branch&api-version=7.1
HTTP/1.1 404 Not Found
{"$id": "1", "innerException": null,
"message": "TF401175:The version descriptor <Branch: no-such-branch > could not be resolved to a version in the repository dotnet-public-wiki",
"typeName": "Microsoft.TeamFoundation.Git.Server.GitUnresolvableToCommitException, Microsoft.TeamFoundation.Git.Server",
"typeKey": "GitUnresolvableToCommitException", "errorCode": 0, "eventId": 3000}
What got it in the same test
main: 200, the file. Every other name below got 404 and TF401175.refs/heads/main, also when encoded asrefs%2Fheads%2Fmain:<Branch: refs/heads/main >. WithversionType=branch, the name goes withoutrefs/heads/.MAIN: the case has to match.mainwith a trailing space (main%20): the message shows two spaces before>.refs/pull/1/mergeandpull/1/merge: a pull request's merge ref is not a branch.mainwithversionType=tag:<Tag: main >. The type is part of what is looked for.- The same 404 came from
diffs/commits(a missingbaseVersionortargetVersion), fromcommits?branch=and fromcommits?searchCriteria.itemVersion.version=. In the web portal, a link with?version=GBno-such-branch(GBfor a branch,GTa tag,GCa commit) showed the same TF401175 on the page.
Two answers that are not TF401175:
- An empty version is not an error.
versionDescriptor.version=read the file from the default branch with 200, anddiffs/commitswith an emptybaseVersioncomparedmainwith itself: no changes,aheadCount0. An empty pipeline variable can give a wrong answer with no error at all. - A commit gets other errors. With
versionType=commit, a 40-character ID that is not in the repository gotTF401029: Couldn't find Git commit with ID …(404), and a 7-character one got 400:An object ID must be 40 characters long and only have hex digits.
Where it comes from, in public reports
- A source branch deleted when the pull request was completed. The pull request still names it in
sourceRefName, so whatever reads it by name afterwards gets TF401175: a dependency-update service cleaning up after a merge (2024), a scanner commenting on a pull request (2024), and an IDE plugin whose pull request list failed ondiffs/commits?baseVersion=<source branch>(2024, fixed in its next version). Read a pull request's files by commit instead: the pull request keeps the IDs inlastMergeSourceCommitandlastMergeTargetCommit. - The pipeline's branch variable passed as it is.
Build.SourceBranchisrefs/heads/main, and in a pull request buildrefs/pull/1/merge: neither is a branch name.Build.SourceBranchNameis not the fix, because it is only the last part:refs/heads/feature/toolsgivestools(Microsoft's predefined variables). Cut the prefix instead:b="${BUILD_SOURCEBRANCH#refs/heads/}"In a pull request build, the branch under review isSystem.PullRequest.SourceBranch, set only when a branch policy ran the build. In 2021 a pipeline task that creates pull requests turnedrefs/pull/12/mergeintobaseVersion=2/merge; it now stripsrefs/heads/andrefs/pull/first. - Another repository. In 2021 the same task, set to open the pull request in a second repository, asked that repository for the branch the pipeline had built, which only the first repository had. The repository at the end of the message is the one that was asked.
- A name the link changed. In 2019 an editor's "open on remote" link turned a branch named
#123.fix-all-the-thingsinto%2523123…: encoded twice, so the server looked for a name starting with%23. A name with#has to be encoded exactly once. - A default branch that is not
main. In 2022 a migration tool asked formainin a repository that had no such branch.defaultBranchinGET …/repositories/{repository}says which branch it is.
What to check
- Copy the name from the raw response and compare it with the branches:
GET …/refs?filter=heads/<start of the name>lists those whose names start with it, asrefs/heads/…. - Is it the right repository? The message names the one it looked in.
- Was the branch deleted? In the web portal, on Branches, search for the exact name and select Search for exact match in deleted branches: it shows who deleted it and when, and Restore branch brings it back. Deleted branches are kept with no time limit (Microsoft's Restore a deleted Git branch).
- If the name is right, check the type: a branch asked for as a tag was not found, and the other way round is the same.
Azure DevOps pull requests in IntelliJ IDEA and Rider
Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, reads the organization, project and repository from your git remote and lists the pull requests that wait for your review in an IDE tool window, on Azure DevOps Services and on Azure DevOps Server. It reads a pull request's files by commit ID, from the pull request's last merge source and target commits, so a deleted source branch does not stop its diffs. It uses branch names only when you create a pull request, and then names the source or target branch that the server does not have. The review inbox and diffs are free; voting, commenting, completing and creating are Pro, with a 30-day trial.
Get it on JetBrains Marketplace
Azure DevOps is a trademark of Microsoft Corporation; IntelliJ IDEA and Rider are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.
More: TF401174: the file is not there in that version · TF401398: the source or the target branch is missing · TF401019: the repository does not exist or you have no permission · 日本語