Kriss Milne
Kriss Milne

Reputation: 529

Set VSTS Compare Branch using REST API

In Visual Studio Team Services (VSTS) using the documented REST API (latest documentation) you can initialize your first branch, create additional branches and update a GIT repository's default branch.

When updating the default branch, the new default branch automatically becomes the compare branch.

So my question is, is there a way using the REST API to modify the compare branch?

Upvotes: 0

Views: 691

Answers (1)

starian chen-MSFT
starian chen-MSFT

Reputation: 33738

Patch https://{account}.visualstudio.com/_apis/Settings/Repository/{repository id}/Entries/me?api-version=4.1-preview.1

Content-Type: application/json

Body:

{
    "Branches.Compare":"refs/heads/Dev1"
}

You can get repository id through Git repositories REST API.

Upvotes: 1

Related Questions