如何使用 Mercurial 忽略 Eclipse 项目的 .classpath?
我正在尝试在我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该文件不得已提交为被忽略(正如您在问题中指出的那样),否则需要“
hg remove -Af .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:
should be enough (no '*' needed)