How to compare two versions in Bitbucket?

My team uses Bitbucket for our git repository, and we recently started using the request request function to view the code. It works fine in the first review, but if it goes through several iterations (i.e. changes have been made and the download request has been updated), I would like to see the link only with new changes that have been made since the last code review.

I looked at the compare functionality, but the user interface looks like it can only compare branches. Is there an easy way to get the difference between two commits?

+49
git bitbucket code-review
Jan 29 '14 at 16:42
source share
8 answers

This is just a small modification to the answers that have already been given, but adding #diff to the end instead of #commits is usually what I'm looking for. Like others, you may have mentioned that the best results for me are usually obtained by putting a new commit first and older than one second, but that will depend on your specific needs.

https://bitbucket.org/<OWNER>/<REPO>/branches/compare/<commit-hash>..<commit-hash-older>#diff 
+42
Aug 03 '15 at 20:11
source share

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

+19
Sep 01 '14 at 2:26
source share

Bitbucket now supports tag comparison.

 https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<tag1>%0D<tag2> 
+11
Jun 26 '16 at 22:26
source share

I have a 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 searched for this answer because in my project we use git submodules, and in pull requests I can only see the old commit sha vs new commit sha of each changed submodule. There is no link to click or anything (that I know) to switch to this kind of diff. This url allows me to see what has changed in the submodules.

Btw, if someone knows a better way to compare two commits in submodules during a pull request, let me know.

+6
Nov 03 '16 at 18:46
source share

The Bitbucket view format is as follows:

 https://bitbucket.org/<owner>/<repo>/branches/compare/<new>%0D<old> 

Given the ged/ruby-pg example (RubyGem, ruby ​​library):

To compare the two releases (v0.18.1 through v0.18.2)

https://bitbucket.org/ged/ruby-pg/branches/compare/v0.18.2%0Dv0.18.1

To compare two versions (from f97dd6c to 22a3612)

https://bitbucket.org/ged/ruby-pg/branches/compare/22a361201fd1d387d59a066b179124694a446f38%0Df97dd6cb4f34da6a62c4339887249115c7c25b9c

+1
Jul 15 '15 at 7:08
source share
0
Dec 31 '15 at 10:44
source share

Create a shortcut for the commits (s) you want to compare. git -a [tagname] [commit_sha]

Then in Bitbucket the comparison menu (the one that needs to make pull requests) is simply compared to tags.

0
Feb 17 '17 at 2:31 on
source share

Through the terminal, run git on the path to the project:

git diff <new commit> <old commit>

Example: git diff 26cf60f be5f978

-3
Feb 25 '17 at 1:01
source share



All Articles