EGit fails to import an existing Git working copy

I used another Git tool to clone my git repository into my development directory, which is also my workspace directory in Eclipse. I then wanted to add this working copy as a project in Eclipse; it has a .project file as it’s already an Eclipse project (previously in an SVN repository).

Using the File > Import menu option and choosing Projects from Git, I was able to add my Git repository (which is inside the working copy), but when I go through to import existing projects it fails with an error:

Invalid project description.
/Users/karlvr/Development/projectname overlaps the location of another project: 'project name'

This turns out to be because importing projects from Git wants to make a new working copy in your workspace, much like with SVN where the wording was more obvious to me “Checkout Projects from SVN”

What I actually wanted to do, and what worked, was to import the project as an existing project and then activate it with Git. To do this, choose File > Import, then Existing Projects into Workspace. Choose your project directory, probably already located in your workspace, and import it. Right-click on the imported project in the Project Explorer and choose Team > Share Project. Choose Git as the repository type, then in the Configure Git Repository dialog choose “Use or create repository in parent folder of project”. EGit will find the .git folder at the root of your project and your project will now be in Eclipse and setup for EGit.

This was posted 2 months ago. It has 0 notes.