vscode-git-graph icon indicating copy to clipboard operation
vscode-git-graph copied to clipboard

How to compare commits between two branches?

Open cesar-rl opened this issue 10 months ago • 8 comments

I am sorry to ask this probably basic and stupid question, but how can I compare the commits on two different branches, or make commands between branches (basically compare or merging/rebasing changes)?

I'm trying to stop using Intellij Idea, and I basically need the functionalities of seeing the different branches, comparing commits between two branches and merging some other branch commits into the current one.

Thank you in advance!

cesar-rl avatar Feb 26 '25 09:02 cesar-rl

(Needless to say I'm a brand new user.)

cesar-rl avatar Feb 26 '25 09:02 cesar-rl

Comparing is simple: CTRL+Left Mouse button to select the two commits. However I'd have a related question: Whenever I select another file in the compare overview, a new TAB will get opened, which is quite unfortunate if you want to compare multiple files.

Not sure whether there's a way to tell git-graph to not always open a new TAB for the file diff, but re-use the same tab, similar to what Git-Extensions is doing?

schwaerz avatar Feb 26 '25 09:02 schwaerz

Comparing is simple: CTRL+Left Mouse button to select the two commits. However I'd have a related question: Whenever I select another file in the compare overview, a new TAB will get opened, which is quite unfortunate if you want to compare multiple files.

Not sure whether there's a way to tell git-graph to not always open a new TAB for the file diff, but re-use the same tab, similar to what Git-Extensions is doing?

but how to select commits in 2 different branches?

kiinoo avatar Nov 05 '25 03:11 kiinoo

@kiinoo I am not sure whether we are talking about the same thing? You can just ctrl+click any two commits to compare them

Image

schwaerz avatar Nov 05 '25 09:11 schwaerz

@schwaerz commits in 2 branches may not be shown at the same time, see below:

Image

How can I compare "1" (in branch "aa") and "ignreo .env" (in branch "main") commits?

kiinoo avatar Nov 11 '25 11:11 kiinoo

Sorry, not clue what's going on on your end. The screen shot looks very much different to what I see on my end.

If you're sure that this graph is rendered from the same plugin, there's probably a setting to display every branch in a separate tab? On the other hand, as the branches itself are displayed differently compared to my screen shot I rather believe that we're not using the same plug-in.

schwaerz avatar Nov 11 '25 16:11 schwaerz

@schwaerz i see, I'm using vscode default git graph in the left side pane, thought it is this plugin...

kiinoo avatar Nov 14 '25 04:11 kiinoo

Just today I found the same graph (the one you were seeing)...

Lost that button to open the graph, but it is still available in ...

Image

schwaerz avatar Nov 14 '25 16:11 schwaerz