无法将本地 git 导入 Eclipse 以创建新项目(抛出错误“Connecting Git team provider failed”)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36191347/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cannot import local git into Eclipse to create a new project (throws error "Connecting Git team provider failed")
提问by Don Rhummy
I created a git repository on my local computer:
我在本地计算机上创建了一个 git 存储库:
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:
然后我进入 Eclipse 并选择从该 Git 存储库导入并创建一个新项目。在向导步骤中,它识别出该.git
目录并将其视为一个存储库(当我检查“首选项”时,它显示在存储库下)但是当我单击以创建新项目时,它每次都失败:
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?
编辑:如果我将它作为一般项目而不是作为新的 Java 项目导入,那么它就可以工作了!为什么?
回答by howlger
In the Import Projects from Gitdialog the Use New project wizardoption seems to be broken (see Eclipse bug 324145).
在Import Projects from Git对话框中,Use New project 向导选项似乎已损坏(请参阅Eclipse 错误 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.javafile the project is detected and configured as a Java project. The local Git repository is also detected and added automatically.
要导入现有的 Git 存储库,请使用File > Open Projects from File System...(而不是File > Import... > Git > Projects from Git)。由于包含TestGit.java文件,项目被检测并配置为 Java 项目。还会自动检测并添加本地 Git 存储库。
Only if it is a Gradleproject (if it contains a build.gradle
file), use File > Import...: Gradle > Existing Gradle Projectinstead (at least until this feature request is implemented).
仅当它是Gradle项目(如果它包含build.gradle
文件)时,才使用File > Import...: Gradle > Existing Gradle Project(至少在实现此功能请求之前)。
回答by Giuseppe Valentino
It worked for me: after selected Use New project wizardoption, pay attention to select the workspace location, it should be set at the local repository location and not at the default workspace location. I hope this help you!
它对我有用:选择使用新项目向导选项后,注意选择工作区位置,它应该设置在本地存储库位置而不是默认工作区位置。我希望这对你有帮助!