Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Diff between a current state of a file and the commited version
Diff between a current state of a file and the commited version [message #758453] Wed, 23 November 2011 05:44 Go to next message
Eclipse UserFriend
Hello,

When I was using SVN, in order to have a view of my modifications on a file before any commit, I used Team/Synchronize.

In EGit, I'd like to be able to compare the current state of a file, and the last commit I did locally.

It seems that view Team/Synchronize compare only with the file on the server.

[Updated on: Wed, 23 November 2011 06:19] by Moderator

Re: Diff between a current state of a file and the commited version [message #758519 is a reply to message #758453] Wed, 23 November 2011 09:47 Go to previous messageGo to next message
Eclipse UserFriend
You want "Team -> Synchronize Workspace" in this case, not "Team -> Advanced-> Synchronize". The first one compares your working directory to the Index. The second one compares the active branch to some other reference. You get the advanced version if run the "Synchronize..." toolbar item.

Or consider using the 'Git Staging' view instead of the synchronization perspective. I find it much handier for this purpose.
Re: Diff between a current state of a file and the commited version [message #758567 is a reply to message #758519] Wed, 23 November 2011 12:34 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
It seems that view Team/Synchronize compare only with the file on the server.


Oodini, what do you mean by "compare only with the file on the server" ?

Quote:
You want "Team -> Synchronize Workspace" in this case, not "Team -> Advanced-> Synchronize". The first one compares your working directory to the Index. The second one compares the active branch to some other reference. You get the advanced version if run the "Synchronize..." toolbar item.


Actually "Team -> Synchronize workspace" will compare yours local working copy with HEAD version (not against git index). In "Workspace" presentation model all changes that are in git index and in yours working copy will be squash together, if you will switch to "Git Commits" model changes will be spited into "<working tree>" and "<staged changes>".

Same rules apply to "Team -> Advance -> Synchronize" with a slightly difference. In this case you can also see changes from other commits that are in one branch but not in the other one. Also "Workspace" presentation model will squash all changes together, but "Git Commits" model will show additional commit nodes for each commit and will present changes introduced by this commit inside this node.
Re: Diff between a current state of a file and the commited version [message #758596 is a reply to message #758567] Wed, 23 November 2011 14:55 Go to previous messageGo to next message
Eclipse UserFriend
re: "Team -> Synchronize workspace" will compare yours local working copy with HEAD version (not against git index)"

Right, sorry, I garbled what I had in mind, which was that this view lets you add and/remove un-commited changes to/from the Index.

I think we can take for granted that "compare with file on the server" means "compare with the version in the corresponding branch of the origin repository". This is the closest equivalent to what the SVN team providers do in this perspective.
Re: Diff between a current state of a file and the commited version [message #758607 is a reply to message #758596] Wed, 23 November 2011 15:41 Go to previous messageGo to next message
Eclipse UserFriend
R Shapiro wrote on Wed, 23 November 2011 14:55
I think we can take for granted that "compare with file on the server" means "compare with the version in the corresponding branch of the origin repository". This is the closest equivalent to what the SVN team providers do in this perspective.


Yes in deed, but from the context I understood that "comparing with remote branch" is not a desired result of synchronize action.
Re: Diff between a current state of a file and the commited version [message #759028 is a reply to message #758607] Fri, 25 November 2011 11:35 Go to previous message
Eclipse UserFriend
OK, guys, thanks a lot for the info !
Previous Topic:workaround for the broken aspect of refs/remotes
Next Topic:How to ignore SSL certificates?
Goto Forum:
  


Current Time: Sun Jun 15 05:46:41 EDT 2025

Powered by FUDForum. Page generated in 0.05816 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top