Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot import local git into Eclipse to create a new project (throws error "Connecting Git team provider failed")

Tags:

git

eclipse

egit

I created a git repository on my local computer:

git init
git add TestGit.java
git commit -m "Start"

I then went into Eclipse and chose to import and create a new project from that Git repo. During the Wizard steps, it recognized the .git directory and saw it as a repo (when I check in "Preferences", it shows under repositories) but when I then click to create the new project it fails everytime with:

Connecting Git team provider failed. See log for details.
Connecting Git team provider failed. See log for details.
Error connecting project Git Test, no Git repositories found

What could be wrong?

Edit: If I import it as a general project instead of as a new Java project, then it works! Why?

like image 350
Don Rhummy Avatar asked Mar 24 '16 00:03

Don Rhummy


People also ask

How do I import a Git project into Eclipse?

Copy the GitHub URL of the repository to the clipboard. Open Eclipse and choose Import –> Projects from Git (with smart import) Choose the Clone URI option in the Git import wizard and click Next. Confirm the URI, Host and Repository path parameters and click Next.

How do I get Git options in eclipse?

Step 1: Open Preferences in Eclipse IDE. Then go to Team, then Git & then configuration. There you need to add your user name. You have to use a key as user.name & values as your name.


1 Answers

In the Import Projects from Git dialog the Use New project wizard option seems to be broken (see Eclipse bug 324145).

To import an existing Git repository use File > Open Projects from File System... (instead of File > Import... > Git > Projects from Git). Because of the contained TestGit.java file the project is detected and configured as a Java project. The local Git repository is also detected and added automatically.

Only if it is a Gradle project (if it contains a build.gradle file), use File > Import...: Gradle > Existing Gradle Project instead (at least until this feature request is implemented).

like image 180
howlger Avatar answered Sep 18 '22 06:09

howlger