如何在 Eclipse 中比较 git 中的两个修订版?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1396649/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I compare two revisions in git in Eclipse?
提问by pkaeding
I am using the eclipse plugin for Giton Mac OS 10.6, and I cannot figure out how to compare two version of a file. I can pull up the file's history, and see all of the commits, with their messages, but I can't figure out how to see what changed in each commit.
我在 Mac OS 10.6 上使用Git的eclipse 插件,但我无法弄清楚如何比较文件的两个版本。我可以调出文件的历史记录,并查看所有提交及其消息,但我不知道如何查看每个提交中的更改。
This was very easy with subversion, and I'm sure its easy with Git, if you know where to look (but apparently, I don't).
这对 subversion 来说很容易,而且我相信用 Git 很容易,如果你知道在哪里看(但显然,我不知道)。
Any pointers would be greatly appreciated.
任何指针将不胜感激。
To elaborate on my question, is there a way to access git-diff
in the eclipse plugin?
详细说明我的问题,有没有办法git-diff
在eclipse插件中访问?
回答by slothbear
From the EGit User Guide:
来自EGit 用户指南:
select a Resource (project, folder, or file) in the project explorer or navigator and right-click an action under Compare With.
在项目资源管理器或导航器中选择一个资源(项目、文件夹或文件),然后右键单击比较下的操作。
I just tested this with EGit 1.3.0. You can compare with a commit, HEAD, previous revision, "branch, tag, or reference", Git index, or any item in History.
我刚刚用 EGit 1.3.0 对此进行了测试。您可以与提交、HEAD、先前修订、“分支、标签或引用”、Git 索引或历史记录中的任何项目进行比较。