无法将本地git导入Eclipse以创建新项目(引发错误“连接Git团队提供程序失败”) [英] Cannot import local git into Eclipse to create a new project (throws error "Connecting Git team provider failed")

查看:986
本文介绍了无法将本地git导入Eclipse以创建新项目(引发错误“连接Git团队提供程序失败”)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地计算机上创建了一个git存储库:

I created a git repository on my local computer:

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

然后我进入Eclipse,选择导入并创建一个该Git仓库中的新项目。在向导步骤中,它识别出 .git 目录并将其视为存储库(当我签入首选项时,它显示在存储库下),但是当我单击以创建新项目,每次都会失败,

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

有什么问题吗?

编辑:如果我将其作为常规项目而不是作为新的Java项目导入,那么它将起作用!为什么?

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

推荐答案

从Git导入项目对话框中,使用新项目向导选项似乎已损坏(请参见 Eclipse错误324145 )。

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

要导入现有的Git存储库,请使用 文件>从文件系统打开项目... (而不是文件>导入。 。> Git>来自Git的项目)。由于包含了 TestGit.java 文件,因此该项目被检测到并配置为Java项目。

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.

仅当它是一个 Gradle 项目(如果它包含 build.gradle 文件),请使用 文件>导入...:Gradle>现有Gradle项目 至少在实现此功能请求之前)。

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).

这篇关于无法将本地git导入Eclipse以创建新项目(引发错误“连接Git团队提供程序失败”)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆