2

I have installed egit, and by using Team - Share - commit, assume that I now have a copy of the entire project in the .git directory.

So I do some work on the project and do another commit.

Now if I want to work on the first commit version what steps are needed?
Which egit command gets the saved project and how do I keep it separate from the current project.
Will it show up somewhere that also appears in the Navigation window of Eclipse?

Very basic stuff but as you can tell I am somewhat unclear about how the whole thing works.
I've googled as much as I can around tutorials but I find it difficult to relate to the terms and concepts that seem to be taken for granted.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
ron
  • 5,219
  • 8
  • 39
  • 44

1 Answers1

0

One solution is to click the reset button (or menu team > Reset), and do a reset --hard on the refs you want.

Here is me working on V2 on my "HelloWorld" App, wanting to redo it completely, starting from V1 which in in master HEAD:

git reset --hard on Egit


But if you don't want to lose anything (even though a reset --hard doesn't lose any commits, they are still available through the reflog), another option is to use the history view to create and checkout a new branch from a previous commit:

git checkout on EGit

As you can see, your content is reset to that previous commit, referenced by a new branch (i.e. you can work without being in a DETACHED HEAD mode as in this question), and the package explorer reflects said new branch:

git checkout done on Egit

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thanks for taking the trouble to include screen shots which are a great help. I have backed up my project and then done some committing,changing, branching experiments. Do you know of a tutorial (pref online) that explains in basic, simple terms the concept of things like heads, branches, detached heads etc? – ron Jul 17 '11 at 09:30
  • @ron: one tutorial for Egit is http://www.vogella.de/articles/EGit/article.html. For Git itself, I really recommend following the steps of http://gitimmersion.com/ (to be made with the CLI -- Command Line Interface -- of Git, like msysgit on Windows: http://code.google.com/p/msysgit/). As For the version control terms used in Git, the visual Git reference is nice: http://marklodato.github.com/visual-git-guide/index-en.html. But the Pro Git book is equally useful: http://progit.org/book/ – VonC Jul 17 '11 at 09:57