← Back

Magit

A few magit tricks for myself.

You can use M-x magit-log-buffer-file with an active selection and see only the changes to the selected portion [1]

magit-log-buffer-file shows the git log for the file you're currently editing. But the real power comes when you select a region first: it will filter the log to show only commits that modified those specific lines.

This is incredibly useful for understanding the history of a particular function or block of code without wading through unrelated changes to the rest of the file.


References

  1. @Conscat on Hacker News