Forum Discussion
Alex_Gurman
Jun 16, 2023Copper Contributor
Trying to get list of commits using ADO API from specific tag ("Release ..."), not seeing the option
Trying to get list of all commits for a GIT repo in ADO from a specific tag (Release ...), not seeing the option in Management API https://learn.microsoft.com/en-us/rest/api/azure/devops/git/commits/get-commits?view=azure-devops-rest-7.0&tabs=HTTP
1 Reply
Hi, Azure DevOps does not treat a tag the same way as a branch in every commits API filter. The usual approach is to first resolve the tag to the commit SHA, then use that commit as the starting point for your comparison or history lookup. In practice, call the refs API for refs/tags/yourTagName, get the object ID, then use that commit ID with the commits or push/history APIs depending on whether you want commits reachable from that point or commits between two refs.