View the change history of a file using Git versioning talks about other ways of viewing history of a file in Git.
Can it be done in Emacs Magit?
Git file History provides information about the commit history associated with a file. To use it: Go to your project's Repository > Files. In the upper right corner, select History.
To use Magit, type M-x magit-status or C-x M-g j . You can also type C-x p m to open a Magit status buffer in your project root, if you use that functionality in Emacs. The status window is the most common entryway into Magit, but it is not the only one.
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
)
l
to get log viewing option--
to set the "Limit to files" option (used to be =f
)l
to view the log of the current branchIf you're using Spacemacs, you can get the history of the currently visited file using <SPC> g f h
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With