问题描述
如果我想看到如何 foo.bar
看起来像某些提交< COMMIT_ID>
那么我可以调用:
git show< COMMIT_ID>:foo.bar
pre>
尼斯...如何在
emacs
中执行?使用magit
?使用vc
?说我正在访问文件foo.bar
,我想查找它如何查看< COMMIT_ID>
。解决方案在Emacs中执行此操作的规范方法是使用VC:
Cx v〜$文件缓冲区中的c $ c>将要求您进行修订,然后显示该文件的版本。它应该适用于VC支持的任何控制系统,如Git,Bzr,...
If I want to see how
foo.bar
looked like in some certain commit<COMMIT_ID>
then I can invoke:git show <COMMIT_ID>:foo.bar
Nice... How can I do it in
emacs
? Usingmagit
? Usingvc
? Say I am visiting the filefoo.bar
and I want to look up how it looked in<COMMIT_ID>
.解决方案The canonical way to do that in Emacs is to use VC:
C-x v ~
from the file's buffer will ask you for a revision and then show that file as it was at that revision. It should work for any control system supported by VC, such as Git, Bzr, ...这篇关于使用emacs(和magit?)访问给定的commit / branch / etc中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!