0

I am trying to compare two git branches. With git I would do

git diff banch1..branch2

With the Beyond Compare tool I tried

git difftool branch1..branch2

but now it looks like it's comparing the branches file by file. So I added the --dir-diff (-d) flag

git difftool -d branch1..branch2

but now I get an error

fatal: could not open '/var/folders/zj/btt2_b5d6_b34fndcvzws9jr0000gn/T//git-difftool.VtceWd/left/ED/Template/sun-lncc/Template/dbged' for writing: No such file or directory

How do I fix this?

Manfredo
  • 1,760
  • 4
  • 25
  • 53

2 Answers2

1

Try this:

git diff branch1 branch2 --name-only

This will give you a list of files that are different between the branches. By the way, you don't have to use "branch1..branch2". Difftool visually compares files; if you specify a file:

git difftool branch1 branch2 -- filename

it will only compare those, if not, it will attempt to compare everything that's different and show you in the comparer.

As for your error, there just seems to be a file missing. Make sure you're typing everything in correctly.

  • Yes I actually figured out that the reason was that a folder was missing. I find this strange though. If a certain file/folder has been deleted from a certain version, why not include it in the comparison tree. I mean that could be a relevant change that I want to keep track of.... – Manfredo Feb 01 '18 at 11:03
0

You can try removing the problem file/directory from the diff command as specified in this answer.

e.g.

git difftool branch1 branch2 -- . :^ED/Template/sun-lncc/Template/dbged
AndrewJC
  • 1,318
  • 12
  • 11