Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitkraken - How to compare 2 branches

Tags:

git

gitkraken

Is there any way to compare 2 branches (branch1 and branch2) with gitkraken?

I want a list of files that have changes

like image 225
Michalis Avatar asked Nov 09 '18 22:11

Michalis


People also ask

How do I compare the differences between two branches in GitHub?

On the Github, go to the Source view of your project. You will see a link named 'Branch List'. Once the page opens you can see a list of all the remote branches. Hit on the Compare button in front of any of the available branches to see the difference between two branches.

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.


4 Answers

If you want to find out difference between branch A and B First checkout on branch A then click on branch B and select commits it then you can find changes on right panel.

and can select multiple commit rows in the graph using Shift Click to show its merged diff

like image 141
amin saffar Avatar answered Oct 16 '22 22:10

amin saffar


GitKraken, as far as I know after some looking into that matter, doesn't let you compare branches regarding their commits. One way to do what you want though, is to use Soloing; you right-click the first branch you want to compare and choose 'Solo'. Orange circles will appear to the left of the branches names instead of the eye. Then click the faded orange icon next to the second branch you want to solo. Only those branches will be shown in the commit view.

Then you just select one commit, and click the second while holding Shift. The list of changed files will appear on the right. Clicking on a file will also show you the diff of contents.

It's worth mentioning though that you can't set the direction of the diff (source and target branch) ; but this has helped me to find out what's changed between two branches.

like image 36
Mickael V. Avatar answered Oct 17 '22 00:10

Mickael V.


GitKraken allows you to compare two branches, and the commits from each branch, by CMD/CTRL-clicking the two commits from different branches to see their differences. If you want to compare the latest commits to each branch, you'd CTRL-Click the head commit from each branch.

like image 20
Dave Avatar answered Oct 16 '22 23:10

Dave


I don't know if this feature is recent, but it is very simple in GitKraken now to display the diff of 2 branches.

You just have to click on the commit of the first branch, hold Shift key, and click to the second commit, which can be anywhere so for example a commit of the second branch.

You can solo the 2 branches for simplifying the graph before to do this action.

like image 2
pom421 Avatar answered Oct 16 '22 22:10

pom421