eclipsegitgithubegit

Deleting Git repository has deleted my project


After migrating my Eclipse setup to a new PC and spending several days working on a project, I decided I better get the changes up on Git.

I created an empty Git repository at: C:\Users\groob\git

Couldn't see how to add my files to it, so I right-clicked the project and selected Teams > Share... and created a Git repository at: C:\Users\groob\git\listen

At this point, I had two repositories, including one I didn't need, so I deleted C:\Users\groob\git

Now on restarting Eclipse, the project is gone, and more worryingly, the files are nowhere to be seen in the Explorer window.

Nothing in the Eclipse project: enter image description here

Nothing in the Git directory: enter image description here

Or the Workspace: enter image description here

Even the trash is empty!

Where did they go and how can I get them back?


Solution

  • So creating a repository doesn't copy the files, it moves them?

    It does not copy or move files, your files were still in Users\groob\git\listen, subfolder of Users\groob\git.
    Deleting the Users\groob\git folder will remove everything under it, Git repo or not.

    Don't create an empty Git repo first, but do share directly your existing project.