Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compare two revisions in git in Eclipse?

Tags:

git

eclipse

I am using the eclipse plugin for Git on 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.

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).

Any pointers would be greatly appreciated.

To elaborate on my question, is there a way to access git-diff in the eclipse plugin?

like image 678
pkaeding Avatar asked Sep 08 '09 22:09

pkaeding


People also ask

How do I compare two versions of files in Git?

You can compare files between two Git commits by specifying the name of the ref that refers to the commits you want to compare. A ref may be a commit ID or HEAD, which refers to the current branch. Let's compare two commits in our Git repository.

How do I compare two EAR files in Eclipse?

To compare two files in Eclipse, first select them in the Project Explorer / Package Explorer / Navigator with control-click. Now right-click on one of the files, and the following context menu will appear. Select Compare With / Each Other.


1 Answers

From the EGit User Guide:

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.

like image 151
slothbear Avatar answered Sep 19 '22 17:09

slothbear