Search code examples
gitpowershellazure-devopsbuild

How to get the list of git commit changes between two build pipelines- Azure DevOps


I want to get a list of git commit changes between two pipelines. The below Azure DevOps GET API is helpful in fetching the git commit changes of a particular build.

https://dev.azure.com/%7Borganization%7D/%7Bproject%7D/_apis/build/builds/%7BbuildId%7D/changes?api-version=7.1-preview.2

I need to fetch all the changes between two builds. Is there any API parameter or script to do this?


Solution

  • I need to fetch all the changes between 2 builds. Is there any API parameter or script to do this?

    Yes. You can use the Rest API: Builds - Get Changes Between Builds

    GET https://dev.azure.com/{organization}/{project}/_apis/build/changes?fromBuildId={fromBuildId}&toBuildId={toBuildId}&api-version=7.1-preview.2
    

    It will return the changes between 2 builds.