Using Azure DevOps REST Api how can I get the default branch?

Viewed 472

When I use the following API:

https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/stats/branches?api-version=6.0

The response contains a key called isBaseVersion. Does this always indicate the default branch?

1 Answers

Does this always indicate the default branch?

Yes. This parameter(isBaseVersion) indicates the default branch.

When the value is true, this means that the branch is the default branch.

Related