如何停止 Egit 在 Flash Builder 中提交其他源文件夹

发布于 2024-12-19 06:41:14 字数 530 浏览 3 评论 0 原文

我正在使用 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 的东西。

我怎样才能忽略这些文件?

I'm using Flash Builder 4.6 (Eclipse 3.7) and Git (eGit plugin).

My project has some additional source folders configured under "Build Path > Source path". When I run a commit, for some reason eGit sees these external files and wants to add and commit them with paths like:

[source path] fruit/com/company/Apple.as
[source path] fruit/com/company/Banana.as

Obviously being outside the project they shouldn't be considered by eGit at all; nevertheless I tried various patterns in my .gitignore to get them ignored, but nothing worked:

fruit
[source*
[source path] fruit/com/company/Apple.as
\[*

Using msysgit, the command git commit -a --dry-run does not attempt to commit these files, so it seems to be an eGit / Flash Builder thing.

How can I get these files ignored?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

虫児飞 2024-12-26 06:41:14

第一步是确保,当您想要忽略某个目录时,被忽略的目录的路径在 .gitignore 中以 / 结尾:

fruit/

这将忽略 .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:

fruit/

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.

花开半夏魅人心 2024-12-26 06:41:14

在 Flash Builder 4.6+ 中安装最新版本的 EGit 之前,我们可以使用以下解决方案(当前存在依赖性问题)。假设(按照建议)您有一个以这种方式定义的链接资源:

[source path] fruit/com/company/Banana.as

您可以手动将位于 [source path]fruit 下的所有文件和文件夹添加到 .gitignore使用 *** 通配符来访问文件:

**/com/company/Banana.as

由于 ** 通配符匹配任何级别的目录,因此您必须确保路径和/或文件名是唯一的,无法在项目的其他地方找到。但是,由于您使用的是反向 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:

[source path] fruit/com/company/Banana.as

You could manually add all files and folders located under [source path] fruit to the .gitignore file by using the * or ** wildcards:

**/com/company/Banana.as

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文