When a file changes on disk while you're editing in Emacs, how to merge both sets of changes into the file?
Asked
Active
Viewed 312 times
2 Answers
3
As you're familiar with ediff you can also:
M-x ediff-current-file
Start ediff between current buffer and its file on disk. This command can be used instead of `revert-buffer'. If there is nothing to revert then this command fails.
I have both this and a custom diff-buffer-with-file variant bound to keys, as I use them quite frequently.
phils
- 48,657
- 3
- 76
- 115
0
Currently I manually resolve the conflict as follows:
write-filethe buffer visiting the original file to a temporary fileediff-merge-filesthe original file and the temporary file- When finished, quit Ediff and confirm when it asks whether to kill buffer A and B.
write-filebuffer B (*ediff-merge*) to the original file
Nova
- 1,059
- 9
- 21