简体   繁体   English

直接从emacs缓冲区查看文件的git历史记录

[英]view a file's git history directly from an emacs buffer

I'm often interested in seeing a file's git history (eg run git log <fname> ) while viewing that file in an emacs buffer. 我经常对在emacs缓冲区中查看文件的git历史记录(例如,运行git log <fname> )感兴趣。 Of course it's possible to just open a shell buffer and issue the command, but surely there must be some fancy-pants way to do this directly. 当然,可以打开一个shell缓冲区并发出命令,但是肯定必须有一些花哨的方法可以直接执行此操作。

The question: 问题:

Do I need to install anything to do that, or is it a standard feature of modern emacs? 我需要安装任何东西来做到这一点,还是现代emacs的标准功能?

As mentioned in the comments, vc is included in Emacs. 如评论中所述, vc包含在Emacs中。 Its keybindings start with Cx v (hit Cx v Ch to see all of them), and the one for viewing the history of a file is Cx vl , for vc-print-log . 它的键绑定以Cx v开始(单击Cx v Ch可以看到所有的键绑定),而用于查看文件历史记录的键绑定是Cx vl ,用于vc-print-log

+1 for magit, it's really handy. 马吉特+1,真的很方便。 http://wikemacs.org/index.php/Magit You can install it with el-get or package.el. http://wikemacs.org/index.php/Magit您可以使用el-get或package.el进行安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM