14

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.

Adi Shavit
  • 16,743
  • 5
  • 67
  • 137
  • How are you running difftool? When I run it (using meld), I get one copy in my workspace and one in /tmp/. – bstpierre Jul 29 '10 at 14:54
  • 2
    I ran `git difftool branch1 branch2`. This was the problem! When I now ran `git difftool branch1` it all worked as expected, with one "side" was the current branch. – Adi Shavit Jul 29 '10 at 18:52
  • 1
    After a long sought debugging process, the above comment is spectacular and fixes my problem that is saving using `git difftool ` was saving to a **temporary** location, not the current branch. See Adi's comment – fungusanthrax May 17 '18 at 18:40

1 Answers1

17

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

Adi Shavit
  • 16,743
  • 5
  • 67
  • 137