让 Mercurial 忽略除某些子目录之外的所有内容
通过搜索,我发现如何让 Mercurial 忽略位于存储库目录根目录中的某些目录(以及它们包含的文件/目录),但我不知道如何扩展它到多个级别的目录。
在这种情况下,我希望仅对以下目录进行版本控制:
app/design/frontend/rc
skin/frontend/rc
因此,我的 .hgignore 文件如下所示。
syntax=regexp
^(?!(app(/|$))|(skin(/|$)))
^app/code
^app/design/adminhtml
^app/design/frontend/base
^app/design/frontend/default
^app/design/install
^app/etc
^app/locale
^app/Mage.php
^app/.htaccess
^skin/adminhtml
^skin/frontend/base
^skin/frontend/default
^skin/install
我确信有一种更好的方法来做到这一点,不需要选择应用程序和皮肤中的其他目录,并且因为我可能想为一些我想在这里问的项目执行此操作。谢谢。
Through searching I've found how to have Mercurial ignore certain directories (and the files/directories they contain) that are in the root of the repository directory, but I can't work out how to extend this to directories that are several levels in.
In this case, I wish to only version control the following directories:
app/design/frontend/rc
skin/frontend/rc
As a result, my .hgignore file looks like this.
syntax=regexp
^(?!(app(/|$))|(skin(/|$)))
^app/code
^app/design/adminhtml
^app/design/frontend/base
^app/design/frontend/default
^app/design/install
^app/etc
^app/locale
^app/Mage.php
^app/.htaccess
^skin/adminhtml
^skin/frontend/base
^skin/frontend/default
^skin/install
I'm sure there's a much better way of doing it that doesn't involve picking out the other directories within app and skin, and as I'll probably want to do this for a few projects I thought I'd ask here. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
手动将所需的目录添加到存储库中,然后忽略其他所有内容。
然后在你的 .hgignore 中:
Manually add the directories that you want to your repository, then ignore everything else.
Then in your .hgignore: