1

I found this API for retrieve all commits:

https://bitbucket.es.ad.adp.com/rest/api/1.0/projects/XXXXX/repos/wwwwww/commits/1afdd692dc99eae74c7280306ca97bcb237bbe5f

but the response includes merge commits. I want only original commits. Is there any way to exclude merge commits from the response?

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257

1 Answers1

2

The Bitbucket Server API documentation shows an optional merges parameter on this endpoint:

if present, controls how merge commits should be filtered. Can be either exclude, to exclude merge commits, include, to include both merge commits and non-merge commits or only, to only return merge commits.

I think something like

https://bitbucket.es.ad.adp.com/rest/api/1.0/projects/XXXXX/repos/wwwwww/commits/?merges=exclude

should do the trick.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257