Community
Participate
Working Groups
Created attachment 198930 [details] Screenshot This scenario encountered in a production environment would likely mean loss of all changes not pushed to the upstream repository: 1. Imported projects from repository git.eclipse.org/gitroot/platform/eclipse.platform.ui.git 2. Tried to switch to an R36 maintenance branch, encountered some exceptions on the way 3. It seemed that projects were partially on master, partially on 36 branch 4. Deleted all projects from the workspace, deleting projects from the disk 5. Tried to import projects from the same clone, but now it says "No projects found" and has an empty list of projects. Restarting Eclipse did not help; workspace is empty.
See bug 350880 for detailed steps "2" and "3".
The issue is caused by deleting projects from disc. It looks like git is not copying files into a workspace, but just working on the git repo wherever it is. So if you delete projects from disc, you delete them from repo - and you cannot import them again. I think it should be impossible to delete files on disc if they come from git.
You should be able to recover from this situation by clicking "Team > Reset" to HEAD with option "hard" this should revert the deletion you did in the file system and bring back these files from the repository database. As a general rule you can assume it's really hard to completely destroy any file you added or committed to the git repository since already on "add" a snapshot of the file(s) being added is copied into the repository's object database. So if you really want to get rid of the file you need to also erase it from the repository. If we would disallow deletion from disk how would you be able to delete a resource and commit this deletion into the repository ? I think what you describe here is not a bug, I also couldn't reproduce bug 350880 with the latest nightly, so it seems this has been already fixed in the meantime.
Closing as worksforme, see comment by Matthias.