2

My Java Project disappeared from the Project Explorer after I performed the following actions with egit:

  • Commit Successfully performed
  • Push to upstream Didn't succeed (not sure about the reason but I think it was because a pull was required first)
  • Pull Egit says the project merged successfully

After I closed the window containing the info on the merge (to which I didn't really pay attention since the repo handles two different projects and the updates were on the one I-m not working on) the project disappeared from the Project Explorer. Any idea why this happened? I'm not looking for a solution to re-import the project but for a reason that explains this behavior.

4
  • 1
    Maybe the .project disappeared? Commented Sep 24, 2014 at 9:54
  • Indeed it did, but I'm not 100% sure I ever pushed it to the repo... Commented Sep 24, 2014 at 9:58
  • may i know, How many members are working in your project? Commented Sep 24, 2014 at 11:09
  • At the moment the active users are 2/3 Commented Sep 24, 2014 at 11:15

1 Answer 1

2

In some cases we get this type of problems, i will explain the points in steps wise

  • If two persons works on the project personA, personB.
  • If personB adds new files, those files path saves in our project binary file. so personsB done Commit and pushed the code.
  • and personA also added new files, here also same way files path saves in our project binary file and performed commit operation and pulled the code which on remote side.
  • Here the situation arise when personA pulls the code conflicts arise in the binary file. in this case project disappears from the Project Explorer.

i faced this type of problem before. i merged both files not worked.

Solution for the above problem

Whenever if we perform pull operation and get conflicts in binary file. I follow the below procedure

  • In this case i use this commandgit checkout --ours binaryfilenamewithpath

    git checkout --ours filename -> it keeps your local file without adding others changes

  • by this we can avoid project disappeared from the Project Explorer cases. Here you get personBs files but files links can not add to the binary file.

  • so manually we have to those files into our project for linking purpose.

  • then you can commit the your project.

I prefer this way to resolve this type of problems. If you have any doubts please ask me.

Solution for your problem

  • Execute git log command it will show your previous commits information with their ids
  • git reset --hard commitid(c14809fa) it will make your local code and local history be just like it was at that commit.
  • pull your code using git pull origin branchname
  • if you get conflict in binaryfile, then your project disappear from eclipse workspace. use this command git checkout --ours binaryfilewithpath to avoid that.
  • if you want to add files to your project and resolve conflicts in other files.
  • then commit your code by using git commit -a -m 'your commit message'
Sign up to request clarification or add additional context in comments.

3 Comments

added solution for your problem check once.
this is ok, but remember I've been using egit, so no command line. And no conflicts were shown btw
i donot know much about egit, but you can install git for your operating system and you can use these commands.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.