Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compare two revisions in Bitbucket?

Tags:

git

bitbucket

People also ask

How do you find the difference between two commits?

To see the changes between two commits, you can use git diff ID1.. ID2 , where ID1 and ID2 identify the two commits you're interested in, and the connector .. is a pair of dots. For example, git diff abc123.. def456 shows the differences between the commits abc123 and def456 , while git diff HEAD~1..

How do I compare two branches in stash?

Currently, the only way to compare branches in Atlassian Stash is to create a pull request first. Otherwise, you can use local git commands to compare arbitrary commits or branches.


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

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


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


Bitbucket supports comparing tags now.

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

I have Bitbucket Server, version:v4.4.1

The answer with me was this.

http://<path-to-my-server>/projects/<project-name>/repos/<repo-name>/commits/<old>?to=<new>

I was looking for this answer because in my project we use git submodules, and in pull requests I can only see the old commit sha vs the new commit sha of each submodule that changed. There is no link to click or anything (that I know of) to jump to this diff view. This url allows me to view what changed in submodules too.

Btw, if someone knows of a better way of comparing two commits in submodules during a pull request, please let me know.