如何停止 Egit 在 Flash Builder 中提交其他源文件夹
我正在使用 Flash Builder 4.6 (Eclipse 3.7) 和 Git (eGit 插件)。
我的项目在“构建路径>源路径”下配置了一些额外的源文件夹。当我运行提交时,出于某种原因,eGit 会看到这些外部文件,并希望使用以下路径添加和提交它们:
[source path] fruit/com/company/Apple.as
[source path] fruit/com/company/Banana.as
显然,在项目之外,eGit 根本不应该考虑它们;尽管如此,我在 .gitignore 中尝试了各种模式来忽略它们,但没有任何效果:
fruit
[source*
[source path] fruit/com/company/Apple.as
\[*
使用 msysgit,命令 git commit -a --dry-run 不会尝试提交这些文件,所以看起来成为 eGit / Flash Builder 的东西。
我怎样才能忽略这些文件?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
第一步是确保,当您想要忽略某个目录时,被忽略的目录的路径在
.gitignore
中以/
结尾:这将忽略
.gitignore
目录中的 >fruit 目录(因此请确保将所述.gitignore
放在正确的位置)但是,关于 链接文件夹(这就是
fruit
,因为OP Fletch 在评论中提到),.gitignore
不起作用。< br>EGit 默认情况下应忽略链接文件夹:请参阅 错误 333338。
补丁已编写,但尚未集成到最新的 Egit 版本中。
更新:自 EGit 2.3(2013 年 2 月)开始,链接文件夹现在在 Egit 中被忽略。
A first step is to ensure, when you want to ignore a directory, that the path of the directory ignored ends with a
/
in your.gitignore
:That would ignore
fruit
directory within the directory of the.gitignore
(so make sure to place said.gitignore
at the right place)However, regarding linked folder (which is what
fruit
is, as the OP Fletch mentions in the comment),.gitignore
will not work.Linked folder should be ignored by defaults by EGit: see bug 333338.
The patches are written, but not yet integrated into the latest EGit release.
Update: Since EGit 2.3 (February 2013), linked folders are now ignored in Egit.
在 Flash Builder 4.6+ 中安装最新版本的 EGit 之前,我们可以使用以下解决方案(当前存在依赖性问题)。假设(按照建议)您有一个以这种方式定义的链接资源:
您可以手动将位于
[source path]fruit
下的所有文件和文件夹添加到.gitignore
使用*
或**
通配符来访问文件:由于
**
通配符匹配任何级别的目录,因此您必须确保路径和/或文件名是唯一的,无法在项目的其他地方找到。但是,由于您使用的是反向 DNS 命名约定,因此此解决方案可能就是您所需要的。Here's a solution that we can use until we can install the latest version of EGit in Flash Builder 4.6+ (there is currently a dependency issue). Let's say (as suggested) that you have a linked resource defined in this way:
You could manually add all files and folders located under
[source path] fruit
to the.gitignore
file by using the*
or**
wildcards:Since the
**
wildcard matches any level of directories, you would have to be sure that the paths and/or file names are unique and cannot be found elsewhere in the project. But, since you are using a reverse-dns naming convention, this solution might be all you need.