Danny Garcia
Danny Garcia

Reputation: 841

Is it possible to compare multiple branches to one in git?

Would it be possible to compare Branch 1 and Branch 2 changes against Master in this scenario?

*   * Branch 2
|  /
|/ 
| * Branch 1
|/
* Master

Ideally this is something difftool would be able do.

Upvotes: 3

Views: 2548

Answers (1)

VonC
VonC

Reputation: 1327224

Not in one operation: comparing multiple branches with master would be a sequential process:

  • comparing Branch1 with master
  • comparing Branch2 with master

"Showing which files have changed between git branches" illustrates (using meld and git difftool)

git difftool -d master otherbranch

With:

-d
--dir-diff

Copy the modified files to a temporary location and perform a directory diff on them. This mode never prompts before launching the diff tool.

Upvotes: 2

Related Questions