Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319972 - Cannot create a new project in an existing repository
Summary: Cannot create a new project in an existing repository
Status: RESOLVED WORKSFORME
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-15 08:14 EDT by Milen Manov CLA
Modified: 2010-09-07 04:34 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milen Manov CLA 2010-07-15 08:14:27 EDT
I have imported a git repository and I am trying to create a new project in it through Import projects action. I select Use the New Project wizard, and create a new Java project. The new project is created but I receive the following error  "No Git repository for project ..." and the project is not added in the repository.
Comment 1 Mathias Kinzler CLA 2010-07-22 07:40:35 EDT
(In reply to comment #0)
> I have imported a git repository and I am trying to create a new project in it
> through Import projects action. I select Use the New Project wizard, and create
> a new Java project. The new project is created but I receive the following
> error  "No Git repository for project ..." and the project is not added in the
> repository.

I played around with this and to me it looks like a shortcoming of the new project wizard for Java projects. If you use this wizard and only type the project name into the "New Java Project" wizard page, the project will always be created in the workspace. However, what you want to do is to create this project as child of your repository working directory (I guess). You can do so by selecing the radio button "Create project from existing source" and entering something like <repository working tree root>/<yourProjectName> (you also have to specify the project name in the Project name field).
Now, the catch is that if <repository working tree root> is inside your workspace, it seems that the project will always be created as direct child of the workspace (not sure if this is a bug).
It does work for me if the repository working tree is located outside the workspace, i.e. if you cloned your repository to let's say <user directory>/<repository name> instead of to <workspace location>/<repository name>.
Can you confirm this behavior?
I think we should think of changing the default for the target location in the clone wizard to point to <user dir>/<repository name> in order to avoid these kinds of problems in the future.
Comment 2 Stefan Lay CLA 2010-09-07 04:34:50 EDT
This is not an egit bug but a limitation of the New Java Project wizard.