git项目的Eclipse设置 [英] Eclipse setup for git project

查看:134
本文介绍了git项目的Eclipse设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个主题有很多问题,但现在没有令人满意的答案,例如这个

There are quite a few questions on this topic, but there are no satisfactory answers unitl now, e.g this.

我使用Eclipse Kepler(20130529 -2219),使用ME2(1.4.0.20130601-0317)和Eclipse Git Team Provider(GIT 3.0.0.201306040240-rc3的Java实现)。所以我在阅读了很好的git之后开始非常期待。

I'm using Eclipse Kepler (20130529-2219), with ME2 (1.4.0.20130601-0317) and Eclipse Git Team Provider (Java implementation of GIT 3.0.0.201306040240-rc3). So I started with great expectations after reading how great git is.

首先,我打开了一个现有的项目,并删除了所有的.svn垃圾,并将其提交给了一个本地git仓库。完美 - 现在是将文件推送到远程存储库的时候了。在Windows上创建 known_hosts 文件之后遇到一些问题,推送成功。

Firstly, I opened an existing project and removed all the .svn rubbish and commited it to a local git repository. Perfect - now it is time to push the files to a remote repository. After having some problems creating the known_hosts file on Windows the push was successful.

现在问题开始了:我想拉取存储库的更改,但...未配置为拉。好的,在这里被讨论了这是一个常见的问题,你必须删除项目,然后从远程服务器重新导入以允许拉。

Now the problems started: I wanted to pull changes for the repository, but "... not configured for pull". OK, here it was discussed that this is a common issue, and you have to delete the project and then reimport it from a remote server to allow pulling.

因此我再次设置了一切,拉开了这个项目。直到现在,我总是被告知, .project 文件不应该提交到版本控制,因此我没有包括它们。 import - > import from git - > local-menu不能将repo中的文件识别为Java项目。因此,我可以将项目作为一般项目导入或使用项目wizzard并设置一个新的Maven项目,因为所有信息已经存在于POM.xml中,因此它是愚蠢的。如果我做一个简单的项目导入,Eclipse不知道它是一个Java或Maven项目,并且会抛出大量错误。

Hence, I set up everything again and pulled the project. Until now I was always told that .project files should not be commit to version control, therefore I didn't include them. The "import -> import from git -> local"-menu does not recognize the files in the repo as a Java project. I can therefore only import the project as a general project or use the project wizzard and set up a new Maven project, which is stupid because all information already exists in the POM.xml. If I do a plain project import, Eclipse does not know that it is a Java or Maven project and throws tonnes of errors.

问题跳过详细问题):当没有 .project 文件存在时,是否有一些不太尴尬的方法从远程git repo导入Maven和Java项目?

Question (skip detailed problem): Is there some less awkward way to import a Maven and Java project from a remote git repo when no .project file exists?

推荐答案

最简单的解决方案:包括 .project 一个href =https://stackoverflow.com/a/12784799/6309>这个答案)在你的git repo。

Easiest solution: do include the .project (as in this answer) in your git repo.

还要包含 .classpath ,因为您现在可以引用相对路径在其中,而不是绝对路径:请参阅 .classpath .project - 检查版本控制?

And do include also the .classpath, since you now can reference relative paths in it, instead of absolute path: see ".classpath and .project - check into version control or not?"

这篇关于git项目的Eclipse设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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