Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » 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 10:44 Go to next message
Harry Houdini is currently offline Harry Houdini
Messages: 131
Registered: February 2010
Senior Member
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 11:19]

Report message to a 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 14:47 Go to previous messageGo to next message
R Shapiro is currently offline R Shapiro
Messages: 386
Registered: June 2011
Senior Member
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 17:34 Go to previous messageGo to next message
Dariusz Luksza is currently offline Dariusz Luksza
Messages: 40
Registered: July 2010
Member

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 19:55 Go to previous messageGo to next message
R Shapiro is currently offline R Shapiro
Messages: 386
Registered: June 2011
Senior Member
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 20:41 Go to previous messageGo to next message
Dariusz Luksza is currently offline Dariusz Luksza
Messages: 40
Registered: July 2010
Member

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 16:35 Go to previous message
Harry Houdini is currently offline Harry Houdini
Messages: 131
Registered: February 2010
Senior Member
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: Sat Oct 25 21:22:34 GMT 2014

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

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