1

I am trying to get the list of files that changed in a commit in AzureDevOps. Is there an api to get this information ?

I am using this but not able to get the information for files.

https://learn.microsoft.com/en-us/rest/api/azure/devops/build/attachments/get?view=azure-devops-rest-6.0

var attachment = buildClient.GetAttachmentsAsync(projectName, buildRunId, commititem.Type).Result;

The above code returns empty value.

Spartan87
  • 119
  • 1
  • 8

1 Answers1

1

Is there an api to get this information ?

Yes. You can get the file names in a commit with this API: Commits - Get Changes

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/changes?api-version=6.0

For .net sdk, you can refer to this class: GitCommitChanges Class

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28