Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compare and Edit Branches in Git with a Mergetool

I have 2 branches that I can compare/diff using my difftool (Beyond Compare). However, the files used for the diff are temporary copies and not the actual files from the current branch. This means that if I want to make a change to an existing file, I cannot do it via the difftool. I would need to make a copy of the files of one branch, checkout the other branch and use a regular diff between the actual files.

Is there a way to get the difftool to use the actual files of the current branch (at least on one side)?

UPDATE and SOLUTION:

The command I used was git difftool branch1 branch2. This diffs 2 branches regardless of the current branch.

The command git difftool branch works as desired, with one "side" as the currently checked-out branch.

like image 365
Adi Shavit Avatar asked Jul 29 '10 14:07

Adi Shavit


1 Answers

The command git difftool branch works as desired, with one "side" as the currently checked-out branch.

like image 196
Adi Shavit Avatar answered Sep 30 '22 16:09

Adi Shavit