Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » How to revert changes?(Question, need support!)
How to revert changes? [message #502404] Mon, 07 December 2009 21:13 Go to next message
Michael Heuberger is currently offline Michael Heuberger
Messages: 30
Registered: December 2009
Member
Good day

Sorry for this noob question but I have no idea how to revert changes with the EGit plugin.

For example I added a line in index.php for debugging purposes and want to revert it.

Thank you for your advice.

Michael H.
Re: How to revert changes? [message #502428 is a reply to message #502404] Tue, 08 December 2009 03:09 Go to previous messageGo to next message
Christian Halstrick is currently offline Christian Halstrick
Messages: 99
Registered: July 2009
Member
Hi,

whenever I want to revert some (or all) changes I did to a file I
- rightclick on it
- select "Compare With->Git Index"
- now I can select which changes in the file to revert. To revert completely select the icon "Copy all non-conflicting changes from Right to Left"


Ciao
Chris
Re: How to revert changes? [message #502592 is a reply to message #502428] Tue, 08 December 2009 18:26 Go to previous messageGo to next message
Michael Heuberger is currently offline Michael Heuberger
Messages: 30
Registered: December 2009
Member
Thank you. But that's just coping the content and Git is incrementing the version anyway. This could confuse other team members.

I prefer something like a rollback.
Re: How to revert changes? [message #502637 is a reply to message #502592] Wed, 09 December 2009 04:13 Go to previous messageGo to next message
Christian Halstrick is currently offline Christian Halstrick
Messages: 99
Registered: July 2009
Member
Hi,

to make one thing clear: I also think a button in the context menu of the File saying "Team->Revert" would be helpful. It is just missing (or we two haven't found it yet Wink)

But this button would not do more then, now I citate you, "just coping the content". There is not more to do to revert a file which is not added to the index than to "just copy old content". Since you haven't "checked-out" the file explicitly there is also no explicit revert"

And specifically git will not "increment the version" as you assumed. Git stores content and two times the same content is the same version for git. You can easily try that out with native git.
Get a project and add a line to the file. Call "git status" and you see the file. Now edit the file again and remove that line. Call "git status" again and you see that no file is touched. This works even together with the index: add a file with one additional line to the index with "git add". Call "git status" to see this file beeing in the index. Then add the file again but now without this additional line. Afterwards "git status" will tell you there are no changes in the index!





Ciao
Chris
Re: How to revert changes? [message #502664 is a reply to message #502637] Wed, 09 December 2009 05:46 Go to previous messageGo to next message
Michael Heuberger is currently offline Michael Heuberger
Messages: 30
Registered: December 2009
Member
Very interesting, thank you for your good explanations!

I experimented myself and that's true. Git compares by contents.

Anyway, a Team->Revert function would be a nice shortcut, yes.

One last question:
What does the sign ">" means in Zend Studio? Each time I modify a file, it appears? Does this mean that it has changed? By the way, I reverted these files with the previous content but the sign ">" is still there. How can I remove it?
Re: How to revert changes? [message #502731 is a reply to message #502664] Wed, 09 December 2009 09:36 Go to previous message
Matthias Sohn is currently offline Matthias Sohn
Messages: 537
Registered: July 2009
Senior Member
"Michael Heuberger" <michael.heuberger@binarykitchen.com> wrote in message
news:hfnv69$8oj$1@build.eclipse.org...
> One last question:
> What does the sign ">" means in Zend Studio? Each time I modify a file, it
> appears? Does this mean that it has changed? By the way, I reverted these
> files with the previous content but the sign ">" is still there. How can I
> remove it?

the ">" means the file in the working tree is dirty (has some changes which
are not yet staged in the index),
see "Preferences / Team / Git / Label Decorations"

If ">" remains after reverting to previous content this maybe a refresh
problem (then refresh should help) or maybe you still have
some content changes e.g. in whitespace, encoding or line endings.

--
Matthias
Re: How to revert changes? [message #576419 is a reply to message #502592] Wed, 09 December 2009 04:13 Go to previous message
Christian Halstrick is currently offline Christian Halstrick
Messages: 99
Registered: July 2009
Member
Hi,

to make one thing clear: I also think a button in the context menu of the File saying "Team->Revert" would be helpful. It is just missing (or we two haven't found it yet ;))

But this button would not do more then, now I citate you, "just coping the content". There is not more to do to revert a file which is not added to the index than to "just copy old content". Since you haven't "checked-out" the file explicitly there is also no explicit revert"

And specifically git will not "increment the version" as you assumed. Git stores content and two times the same content is the same version for git. You can easily try that out with native git.
Get a project and add a line to the file. Call "git status" and you see the file. Now edit the file again and remove that line. Call "git status" again and you see that no file is touched. This works even together with the index: add a file with one additional line to the index with "git add". Call "git status" to see this file beeing in the index. Then add the file again but now without this additional line. Afterwards "git status" will tell you there are no changes in the index!




--
Ciao
Chris


Ciao
Chris
Re: How to revert changes? [message #576442 is a reply to message #576419] Wed, 09 December 2009 05:46 Go to previous message
Michael Heuberger is currently offline Michael Heuberger
Messages: 30
Registered: December 2009
Member
Very interesting, thank you for your good explanations!

I experimented myself and that's true. Git compares by contents.

Anyway, a Team->Revert function would be a nice shortcut, yes.

One last question:
What does the sign ">" means in Zend Studio? Each time I modify a file, it appears? Does this mean that it has changed? By the way, I reverted these files with the previous content but the sign ">" is still there. How can I remove it?
Re: How to revert changes? [message #576471 is a reply to message #576442] Wed, 09 December 2009 09:36 Go to previous message
Matthias Sohn is currently offline Matthias Sohn
Messages: 537
Registered: July 2009
Senior Member
"Michael Heuberger" <michael.heuberger@binarykitchen.com> wrote in message
news:hfnv69$8oj$1@build.eclipse.org...
> One last question:
> What does the sign ">" means in Zend Studio? Each time I modify a file, it
> appears? Does this mean that it has changed? By the way, I reverted these
> files with the previous content but the sign ">" is still there. How can I
> remove it?

the ">" means the file in the working tree is dirty (has some changes which
are not yet staged in the index),
see "Preferences / Team / Git / Label Decorations"

If ">" remains after reverting to previous content this maybe a refresh
problem (then refresh should help) or maybe you still have
some content changes e.g. in whitespace, encoding or line endings.

--
Matthias
Previous Topic:Git Pull?
Next Topic:Examining remote repositories
Goto Forum:
  


Current Time: Wed Jul 23 02:04:24 EDT 2014

Powered by FUDForum. Page generated in 0.03872 seconds