Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 853
Paul-Joseph de Werk Avatar asked Sep 16 '25 01:09

Paul-Joseph de Werk


1 Answers

WARNING: This may be the accepted answer, but it is false. Multiple branches can be marked isBaseVersion : true. This field does not indicate the default branch.

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.

like image 193
Fairy Xu Avatar answered Sep 17 '25 20:09

Fairy Xu