Diff between arbitrary commits in BitBucket

954 Views Asked by At

I am running bitbucket server v4.14. I want to be able to get diff of any two commits for a repo. I saw this posted at https://bitbucket.org/site/master/issues/4779/ability-to-diff-between-any-two-commits

However the same does not work, probably cause the version I am running is older. The compare page directly takes me to diff across branches. I do not want any UI element, just a URL is fine.

Thanks

2

There are 2 best solutions below

0
On

This feature is not available to Bitbucket 4.14.

You can get this data using the REST API. Try to execute the following command:

curl -s --user USER:PASS --request GET https://BITBUCKET-SERVER/rest/api/1.0/projects/PROJECT/repos/REPOSITORY/commits?since=SINCE-COMMIT\&until=UNTIL-COMMIT | jq --raw-output '.values[] | .displayId+ " " + .author.name'
0
On

AFAIK there is only rest api endpoint. There is a since parameter that you can pass. See the docs for more details.