Reputation: 1910
I was trying to compare two commits on the same branch (master in this case) in BitBucket and did not find a good answer in any forum, so decided to try their client, SourceTree to see if installing it locally would help and it did.
Therefore, thought it might be useful to add question and answer here.
Upvotes: 113
Views: 85495
Reputation: 1767
@kambala's solution is correct but with a simple change. The URL will be encoded and you can't simply use '...'
This url will work
https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<COMMIT_1>%0D<COMMIT_2>
Upvotes: 6
Reputation: 1648
In the Left Pane select Source
, then in the three dots
select the Compare branches or tags
option.
The before action moves to Branches
later select respectively the Branch/Tag
.
Upvotes: 12
Reputation: 2501
This URL worked for me: https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<commit1>..<commit2>#diff
, short hashes can also be used.
Screenshot:
Upvotes: 62
Reputation: 309
I found this feature on the BitBucket web GUI.
Instructions:
This is an important feature, because it gives you a URL you can share with others.
UPDATE: Others have commented this shows the diff for a resultant merge, so it doesn't work exactly like git diff
. I will try to update when I get a chance to experiment with it. I'm not using BitBucket on a day-to-day basis anymore.
Upvotes: 20
Reputation: 1910
Best way I found to solve this at the time was via SourceTree app (for mac in my case). it will automatically show you the latest changes and you can compare specific commits if you like as well.
Thought I would add this here, as did not find a good answer for this question anywhere.
Update, June 29, 2020: Based on answers from reed_do_it and scott-carpenter, went to check this and found that indeed BitBucket now have this feature on the website UI. The version i see on the site, at least for me, is what scott is showing above.
Here is the UI I saw:
Upvotes: 10
Reputation: 1553
BitBucket Cloud (bitbucket.org) supports commit comparison on the branch compare page:
Upvotes: 112
Reputation: 393
I came across this question while looking for a way to compare a single file across two different commits. The instructions for doing so are slightly different than those above, so I wanted to share:
Upvotes: 18
Reputation: 19
I do it like this under Bitbucket v5.9.0.
I don't know why this very primitive functionality is not available without having to use some "tricks".
Upvotes: 1