Magit Log for a File

Here’s a really nice tip from Wilfred Hughes’ Emacs Command of the Day Twitter feed:

This is just the thing if you need to examine to the commit history for a particular file. I ran it on one of my oldest files in Git (9 years) and could see all the changes in a buffer of only 161 lines instead of trying to pick them out from the thousands of lines in a full log listing.

Take a look at the documentation to see some additional capabilities of the command. You can, for instance, select a region in the current buffer and the command will show only the commits that affected those lines.

You can, of course, do the same thing interactively from the Magit menu but not as easily. If you find yourself needing to examine the commit history of a single file (semi-)regularly, it’s worthwhile remembering the magit-log-buffer-file command.

This entry was posted in General and tagged , . Bookmark the permalink.
  • That is awesome. I knew that magit could do this, but I'd never looked it up or realized how useful it would be, Now, to find a suitable key binding....