如何忽略 .svn 文件夹中的 dir-prop-base ?
我读过几篇关于在 Mercurial 中忽略文件的文章,但我对这篇文章感到困惑。
我的存储库中有几个 .svn 文件(我使用 hg 进行本地提交,然后推送到 svn)。这些文件是:
Apps\.svn\dir-prop-base
Apps\.svn\entries
我的 .hgignore
中有几个忽略条目,但它们似乎都没有覆盖这两个文件。
syntax: glob
.svn/*
**/.svn/**.*
syntax: regexp
\.svn\\*
我正在尝试一些事情来看看哪一个能坚持下去。对我来说,看起来这些文件应该被忽略两次。奇怪的是 Apps\.svn\all-wcprops
被忽略了。显然我错过了一些东西。我正在通过使用 TortoiseHg 打开一个新的状态窗口来检查文件是否被忽略。我无法检测到它与 hg status
之间有任何区别。
I've read several posts here about ignoring files in Mercurial but I'm stumped on this one.
I have a couple of .svn files in my repository (I'm using hg for local commits, then pushing to svn). The files are:
Apps\.svn\dir-prop-base
Apps\.svn\entries
I've got several ignore entries in my .hgignore
but none of them seem to be covering these two files.
syntax: glob
.svn/*
**/.svn/**.*
syntax: regexp
\.svn\\*
I'm trying a couple of things to see which sticks there. To me, it looks like those files should be ignored twice. The strange thing is that Apps\.svn\all-wcprops
is being ignored. Clearly I'm missing something. I'm checking whether the files are ignored by opening a new status window using TortoiseHg. I can't detect any difference between that and hg status
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
奥本为我指明了正确的方向。他拒绝回答,所以这里是:
当您编辑忽略文件时,您想要忽略的文件不能处于“添加”状态(因为“添加”显然优先于“忽略”)。所以我的解决方案是执行 hg revert,编辑忽略文件,然后使用 hg status [directory] -i 来查看目标目录中的哪些文件将被忽略。重复此操作,直到忽略所有正确的文件,然后使用
hg add
。Oben pointed me in the right direction. He declined making an answer, so here it is:
The files that you want to ignore can't be in an Add state when you are editing the ignore file (since Add takes precedence over Ignore apparently). So my solution was to do
hg revert
, edit the ignore file, then usehg status [directory] -i
to see which files in the target directory would be ignored. Repeat until all the correct files are ignored, then usehg add
.对我有用。
works for me.
以下简单的 .hgignore 可以很好地让我忽略所有 .svn 文件夹(在 Windows 上,hg 1.7):
The following simple
.hgignore
works fine for me to ignore all .svn folders (on Windows, hg 1.7):