View a file's history in Magit?
Since magit 2.1: magit-log-buffer-file
(as per comment below)
Before magit 2.1: magit-file-log
is what you are looking for. It will show you all commits for the file in the current buffer in the standard magit log view.
Open your magit-status
buffer, by typing M-x magit-status
(I used to have this bound to C-. C-g
because it is used all the time. These days, I use Spacemacs so it's <SPC> g s
)
- Type
l
to get log viewing option - Type
--
to set the "Limit to files" option (used to be=f
) - Enter the file path you wish to view history for
- Type
l
to view the log of the current branch
If you're using Spacemacs, you can get the history of the currently visited file using <SPC> g f h
In your *magit: <project>*
buffer use l
to go into logging mode, then press f
to be prompted for a filename.