Forum Discussion
chamidu_sumanasekara
Nov 08, 2024Copper Contributor
Azure GIT - Looking for a REST API to retrieve commits/PRs between two tags
Hi, I am looking for a rest API to retrieve a list of commits/PRs between two given tags. EX; assume I have one tag named release-202410 from main branch and another tag named release-202411 from ...
balasubramanim
Nov 08, 2024Iron Contributor
To get commits between two tags in Azure DevOps, use the Get Commits Batch API
API Request:
POST https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commitsbatch?api-version=7.1
Request Body:
{
"itemVersion": { "versionType": "tag", "version": "release-202411" },
"compareVersion": { "versionType": "tag", "version": "release-202410" }
}
This gives a list of commits between release-202410 and release-202411.
For PRs, manually cross-reference commit IDs.