View Commit History of a File
Gitv is an extension of the Fugitive plugin that allows you to view and step through the commit history of a file (among other things).
Open a file in Vim and enter the :Gitv!
command to open a preview window listing the commits involving the current file. It will look something like this:
You can skim over these commits and when one looks interesting, just hit enter
when your cursor is over its respective line to view the file as it was at the time of that commit.
Restore your buffer to its original state by navigating to the top of the preview and hitting enter
for the filename on the first line.
This tool is great for use in a team setting when you want to figure out what changes a file has undergone recently, especially when something about a file seems a little fishy. This is also great for individual and team use when you simply cannot remember why you changed a file or what it used to look like before that clever refactoring.
Last updated