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/desig开发者_Go百科n/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.
Manually add the directories that you want to your repository, then ignore everything else.
hg init
hg add app/design/frontend/rc
hg add skin/frontend/rc
Then in your .hgignore:
syntax: glob
**
精彩评论