سؤال

I read few threads on backing out commits. Following are relevant How to delete commits with egit? What's the difference between Git Revert, Checkout and Reset?

But how do I revert/reset/restore back to clean original state. I just started working on new project and the original git directory structure got messed up after the first check in (because I incorrectly created git repository as eclipse project); this problem is discussed in "The short story" or "The longer story" of following link http://wiki.eclipse.org/EGit/User_Guide#Creating_Repositories

Now I wanted to restore the original directory structure of git repo. In History window, I see all the previous commits and I can right click on them and back out to one of previous commits; sadly the history window doesnt show anything to prior first check in (or commit). But I want to back out to the original directory structure that existed prior to first commit (that way I will have clean repo without any code base in it). It doesnt matter if it is restore/reset/revert as long as git repo looks same as it was before first committ. Can I do this in eclipse/egit?

هل كانت مفيدة؟

المحلول

This isn't something that Git would have kept track of.

You might look into the Eclipse local history (which is separate from the history recorded by Git), but that is for a file only. Not a all structure.

It is best to recreate a Git repo, and make as a first commit your clean structure, before adding code base in it.

نصائح أخرى

Go to git perspecive-> Expand the repo. Right click on working tree. Clean. Finish. See the below pasted image link.

clean in git perspective

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top