Git - Changes made to meld (like diffftool) are not saved

I followed Jรถrg W Mittag in response to this post and configured meld as diffftool in my git. Now I can perfectly view and compare the differences in the file in different branches:

git checkout branch1 git difftool branch1:file.f90 branch2:file.f90 

I ran the above command, made and saved the changes to meld. However, when I check the file using:

 emacs file.f90 

Changes I made earlier to meld are not saved at all. I do not understand why this is so; I must have misconfigured meld as a diff tool. Can someone help me with this problem? Thanks!!

+6
source share
3 answers

Since you explicitly specified branches of both files that should be delimited, meld works with temporary copies of both files. Try simply specifying the name of an unoccupied branch: file; this should force meld to compare a temporary copy of this branch: a file with an issued file with the same name.

+3
source

To save your changes, you need to compare some branch with the current working file.

In your case:

 git checkout branch1 git difftool branch2:file.f90 file.f90 

In addition, you can compare the whole branch with the working directory and save the changes. I talked about this in detail here: fooobar.com/questions/11591 / ...

+1
source

To avoid having to provide a file name twice, use the following:

 git difftool branch -- file 

This will compare branch:file with file in the working tree.

In addition, to split the entire working tree into branch , use:

 git difftool --dir-diff branch 

As mentioned in other answers, if you need to split branch into other_branch (any branch is different from what is currently checked), you should first check other_branch before using the above commands.

+1
source

All Articles