3

I want to know if there is a way to have file history in emacs. With file history I mean:

  • List all the times a file has been saved.
  • View the diff between the current file and the file in that version.
  • Revert file to that version.
user3322829
  • 131
  • 4

1 Answers1

1

There is a very simple version system in emacs for individual text files, quoted from: https://www.emacswiki.org/emacs/RevisionControlSystem

"To put a file under VersionControl with RCS type ‘C-x v v’ (‘vc-next-action’).

After making edits,
view the changes with `C-x v =’ (‘vc-diff’).
or check in the revision by typing another ‘C-x v v’.

After entering a log message, complete the check-in with ‘C-c C-c’ (‘vc-finish-logentry’).
Instead of checking in, undo your changes with ‘C-x v u’ (‘vc-revert-buffer’).
At any moment, view a file’s revision log with ‘C-x v l’ (‘vc-print-log’). "

But i think there are more robust and proved options like the integration with git, or the undo-tree https://www.emacswiki.org/emacs/UndoTree (it looks like this:)enter image description here

  • Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill May 22 '19 at 07:34