将 Eclipse 工作区提交到版本控制时应忽略哪些目录/文件?
我是 Eclipse 新手,我有一个 Eclipse 工作区,其中包含 Google Web Toolkit 应用程序的项目。我应该将哪些目录/文件提交给版本控制(我们使用的是 Subversion)?我相信我不需要提交 .metadata 目录,而且在我看来,我不需要提交 war 目录,但我并不肯定。提交的项目需要在多个开发人员之间共享。
I'm an Eclipse newbie, and I have an Eclipse workspace with projects for a Google Web Toolkit App. What directories/files should I commit to version control (we're using Subversion)? I believe I don't need to commit .metadata directories, and it seems to me that I don't need to commit war directories, but I'm not positive. The committed projects need to be shared across multiple developers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
堆栈器 介绍了 Eclipse 的文件,让我介绍一下 GWT ;)
假设您正在使用 标准布局:
正如您所见好坏参半。正如之前建议的,您应该使用
svn:ignore
让 SVN 知道您到底想要将什么置于源代码控制之下 - 显然编译后的输出和类文件已经出来了:)stacker covered Eclipse's files, let me cover GWT ;)
Assuming you are using the standard layout:
So as you can see it's a mixed bag. As it's been suggested before, you should use
svn:ignore
to let SVN know what exactly you want to put under source control - obviously the compiled output and class files are out :)您不应提交包含工件的目录以及需要将项目检出到工作区的
.project
文件。 (如果您需要使用项目的不同版本,这是不可取的)。除非您使用 Maven,否则您可能还想将
.classpath
添加到您的版本控制系统中。请记住,所有团队成员都必须小心,仅将相对路径添加到类路径中。
You shouldn't commit directories which contain artifacts as well as the
.project
file which would demand to checkout the project into workspace. (which isn't desirable if you need to work with different versions of your project).Unless you use maven you might want to add the
.classpath
also to your version-control system.Keep in mind that all team-members have to be careful to add only relative-paths to the classpath.