I figured out I can show old versions of a file using \'git log filename\' to show the commits, and then use \'git show commit-id:filename\' for the old version. But it just
Just use >
and put it into a file that you can open in emacs.
git show commit-id:filename > oldfile
Then open the file in emacs.
Emacs package git-timemachine lets you step back and forth through git revisions of a file:
https://github.com/pidu/git-timemachine
If you are using bash
, you can use Process Substitution.
gvim <(git show commit-id:filename)
Using the following Vim command, one can view a previous version of a file without having to cleanup anything afterward.
git show commit-id:filename | vim - -n
Explanation: The dash argument of the vim command makes vim load whatever comes in from standard input. The -n option suppresses the creation of swap files.