3

I have an eclipse workspace with a bunch of projects from git, I am using egit to manage the project. I typically try out experiments which fail, and I want to take a project and restore it to exactly its state in HEAD of the git repo.

How do I do that with EGit?

I have tried to right click on the project Replace With > Head Revision which causes eclipse to crash. I am new to git migrated from svn. is there an equivalent of svn revert for a project?

2
  • Worth checking which version of EGit you have as 1.3 was released a few days ago. Crashing doesn't sound like a reasonable response if the 'replace with head revision' isn't supported yet.
    – SteveD
    Feb 20, 2012 at 9:22
  • updated to egit 1.3 it seems faster and better.
    – ams
    Feb 21, 2012 at 21:16

1 Answer 1

2

If you don't have any non-versioned files (ie "private" files) that you don't want to lose, then you can try and reset your working tree to your current HEAD.

See "Resetting your current HEAD ", choosing the "hard" option.

2
  • "Resetting to current Head" seems to do it for the whole repo rather than just an individual project in the repo, any way to do it for an individual project?
    – ams
    Feb 20, 2012 at 18:54
  • doing stuff on a pre project basis in git seems to be against the way that git thinks, git seems to be always operating on the whole repo.
    – ams
    Feb 25, 2012 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.