View a file's history in Magit?

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?


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 Mx magit-status (I used to have this bound to C-. Cg because it is used all the time. These days, I use Spacemacs so it's Mm gs )

  • Type l to get log viewing option
  • Type =f to set the "Limit to files" option
  • 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> gfh


    在您的*magit: <project>*缓冲区中,使用l进入记录模式,然后按f以提示输入文件名。

    链接地址: http://www.djcxy.com/p/22664.html

    上一篇: 查看移动文件的GIT历史记录

    下一篇: 在Magit中查看文件的历史记录?