I have two files in two different branches: branch1:./path1/fileA.dat
and branch2:./path2/fileB.dat
.
I want to compare these files with each other and edit one of them, say fileA.dat
, according to the differences shown.
If I checkout branch branch1
and use the command (as stated here):
git difftool branch1:./path1/fileA.dat branch2:./path2/fileB.dat
I am able to see the differences between these files (I use Meld as my difftool) but both are opened as temporary files so I can't really edit fileA.dat
in branch1
because the changes will be lost after I close Meld.
This is not what I would have expected, since if I use a very similar command to compare the same file in these two branches:
git difftool branch1 branch2 file.dat
I can edit it and save the changes.
Am I doing something wrong here or is this just how git
behaves?