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.
You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit. You can also run the git diff <branch_name1> <branch_name2> command to compare the changes from the first branch with changes from the second branch. Order does matter when you're comparing branches.
You can also compare two arbitrary commits in your repository or its forks on GitHub in a two-dot diff comparison. To quickly compare two commits or Git Object IDs (OIDs) directly with each other in a two-dot diff comparison on GitHub, edit the URL of your repository's "Comparing changes" page.
BitBucket Cloud (bitbucket.org) supports commit comparison on the branch compare page:
This URL worked for me: https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<commit1>..<commit2>#diff
, short hashes can also be used.
Screenshot:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With