Bitbucket Rest API获取任何两个分支之间的提交差异

时间:2020-09-04 09:57:05

标签: bitbucket bitbucket-server restapi bitbucket-api

我正在尝试获取两个分支之间存在的提交差异列表以进行报告。 假设我需要找出发布分支中存在的提交,而不是prod分支中的提交。 所以为此,我需要一个来自bitbucket的rest api,它将获取提交的差异。 有帮助吗?? https://bitbucket-xxx/rest/api/1.0/projects/MyProject/repos/repos1/compare/diff?from = release&to = prod

但是它没有给出适当的输出。 我想我没有使用适当的rest api。

1 个答案:

答案 0 :(得分:0)

我不确定Bitbucket Server版本,但对于Cloud版本,有一个API可以为您带来不同的提交。

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"

因此,您可以将源作为发行分支,将目标作为生产分支。该调用将为您提供源中存在但目标中不存在的一组提交。如果响应为空,则源中的所有提交都位于目标中

相关问题