如何从得到复制到bin目录prevent .git目录中重建? [英] How do I prevent .git directory from getting copied to bin directory during rebuild?

查看:187
本文介绍了如何从得到复制到bin目录prevent .git目录中重建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个.git目录反复出现在我的项目,一个目录,我认为应该被忽略内部。它每次我清理项目或刷新它在Eclipse时再次出现。该复制.git目录导致多余的文件prevent该项目从建设。

A .git directory keeps reappearing in my project, inside a directory that I think should be ignored. It reappears each time I clean the project or refresh it in Eclipse. The duplicated .git directory results in redundant files that prevent the project from building.

我在Eclipse中的Andr​​oid项目,从Java项目,这是LibGDX处理项目的方式链接源。我不希望.git目录包含了导致冲突的文件,所以我有我想建立到设备每次都将其删除。

I have an Android project in Eclipse that links source from a Java project, which is the way LibGDX handles a project. The .git directory that I don't want contains a file that causes a conflict, so I have to delete it every time I want to build to device.

这是创建MyProject目录/斌/班/ git的。但我有斌/在我的.gitignore文件。我的仓库是在MyProject的。

It is creating the directory MyProject/bin/classes/.git. But I have bin/ in my .gitignore file. My repository is in MyProject.

有冲突的文件\\ BIN \\ classes.git \\ COMMIT_EDITMSG。这种冲突在我的链接代码Java项目中的文件:\\ gen.git \\ COMMIT_EDITMSG。也同样的问题,因为我已经在该项目的的.gitignore \\根。

The conflicting file is \bin\classes.git\COMMIT_EDITMSG. This conflicts with a file in my linked source Java project: \gen.git\COMMIT_EDITMSG. Also the same issue, because I have \gen in the .gitignore of that project.

我是pretty确保Eclipse或ADT被转移到斌的.git 目录>当重建或清理项目目录。

I am pretty sure either Eclipse or ADT that is copying the .git directory over to the bin directory when it rebuilds or cleans the project.

所以现在我的问题是,我怎么Eclipse和/或ADT停止这样做呢?

So my question now is, how do I get Eclipse and/or ADT to stop doing that?

(如果你想看到我的老的.gitignore,我认为这是无关紧要的,因为它是正确设置忽略bin目录,你可以点击编辑链接,看看它在这个岗位的历史。 )

推荐答案

如果你想要的是排除* git的文件在Eclipse中生成过程中被复制,你可以把这个Java的下构建路径菜单中的特定项目,然后添加*的.git入排除模式。正是在这里相当棘手,因为您可以指定纳入图案,或排除模式,但不是他们两个。所以,也许你想尝试排除* git的,这样它不会生成过程中复制。

If what you want is to exclude *.git file to be copied during the build in eclipse, you can set this under Java Build Path menu for that specific project, and then add *.git into the exclusion patterns. It is quite tricky here because you can either specify inclusion patterns, or exclusion patterns, but not both of them. So, maybe you want to try to exclude *.git so that it does not copy during build.

见下面例如屏幕截图:

这篇关于如何从得到复制到bin目录prevent .git目录中重建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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