如何使用 Mercurial 忽略 Eclipse 项目的 .classpath?

发布于 2024-08-30 20:51:26 字数 393 浏览 2 评论 0原文

我正在尝试在我的 Mac(笔记本电脑)和 PC(台式机)之间共享存储库。该项目有一些外部依赖项存储在每台计算机上的不同位置,并在 Eclipse 项目的 .classpath 文件中注明。当项目更改被共享时,依赖关系就会中断。我正在想办法防止这种情况发生。

我尝试使用 .hgignore 进行以下设置,但没有成功:

syntax: glob
*.classpath

基于这个问题 ,看来 .hgignore 文件不允许 Mercurial 忽略也提交到存储库的文件。还有其他办法解决这个问题吗?配置项目以使其正常工作的其他方法?

I'm trying to share a repository between my Mac (laptop) and PC (desktop). There are some external dependencies for the project that are stored on different places on each machine, and noted in the .classpath file in the Eclipse project. When the project changes are shared, the dependencies break. I'm trying to figure out how to keep this from happening.

I've tried using .hgignore with the following settings, among others, without success:

syntax: glob
*.classpath

Based on this question, it appears that the .hgignore file will not allow Mercurial to ignore files that are also committed to the repository. Is there another way around this? Other ways to configure the project to make it work?

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

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

发布评论

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

评论(1

枕梦 2024-09-06 20:51:26

该文件不得已提交为被忽略(正如您在问题中指出的那样),否则需要“hg remove -Af .classpath”将其从存储库中删除,而不将其从您的本地工作树。

并且:

syntax: glob
.classpath

应该足够了(不需要“*”)

The file must not be already commited to be ignored (as you noted in your question), other wise a 'hg remove -Af .classpath' is required to remove it from the repo without removing it from your local working tree.

And:

syntax: glob
.classpath

should be enough (no '*' needed)

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