0

I am trying to get list of diff of commits present between two branches for reporting purpose. Suppose i need to find out commits which are present in release branch but not to prod branch . So for this i need a rest api from bitbucket which will fetch be diff of commits. Any help ?? https://bitbucket-xxx/rest/api/1.0/projects/MyProject/repos/repos1/compare/diff?from=release&to=prod

But it is not giving a proper output. I guess i am not using proper rest api .

1 Answers1

0

I'm not sure for Bitbucket Server version, but for the Cloud version, there is an API which can give you the difference of commits.

curl --url "https://api.bitbucket.org/2.0/repositories/workspace/repository_name/commits/source_branch?exclude=destination_branch" --user username:password --request GET --header "Accept: application/json"

So you can have the source as the release branch and destination as prod branch. This call will give you the set of commits that are present in source but not in destination. If the response is empty, then all the commits in source is present in destination

AkshayBadri
  • 504
  • 1
  • 10
  • 18