How to compare two revisions in Bitbucket?

My team is using Bitbucket for our git repository and we've recently starting using the pull request functionality for code reviews. It works fine on the first review, but if it goes through multiple iterations (that is, changes are made and pull request updated), I would like to see a link with just the new changes that were made since the last code review.

I looked into the "compare" functionality but the UI looks like it can only compare between branches. Is there a simple way to get a diff between two commits?


Solution 1:

This is just a slight modification to the answers already given but adding #diff to the end instead of #commits is usually what I'm looking for. Also as others may have mentioned the best results for me are usually obtained by placing the newer commit first and the older one second but that will depend on your particular needs.

https://bitbucket.org/<OWNER>/<REPO>/branches/compare/<commit-hash>..<commit-hash-older>#diff

Solution 2:

The search fields in the branch/tag dropdowns on the Compare page on bitbucket.org now supports pasted-in commit hashes.

So now you can just go to https://bitbucket.org/<owner>/<repo>/branches/compare/ and paste the hashes into the dropdowns instead of URL hacking!

drop down, then paste in commit hash

Solution 3:

Try something like:

https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<commit1>..<commit2>#commits

Taken from: https://bitbucket.org/site/master/issue/4779/ability-to-diff-between-any-two-commits

Solution 4:

Bitbucket supports comparing tags now.

https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<tag1>%0D<tag2>