gitgit-diffgit-difftool

Git - apply change made in the difftool


I'm sure this is very basic, but I've read the docs, and still can't figure it out.

I have two branches, and I need to merge some changes in a couple of files in manually (don't ask). I am viewing the files side by side, with the difference highlighted, with:

git difftool branch1 branch2 -- path_to_file

This allows me to copy everything I need into the file that will be remaining (which is in branch1 fwiw), but the file is some long filename in /tmp/. I don't know how to actually save my edits to the file that I am editing (I'm using vim as the difftool, and I have set noreadonly, the issue is that it's a different file (something in /tmp/, as I said).

There are only a couple of changes, and I could just manually edit the file in branch1, but I'm sure that git diff must allow me to do this, and I'd like to learn to do it properly.


Solution

  • I can just force vim to overwrite the original file when it saves... I guess this works fine.