What's the simplest .hgignore syntax to ignore a directory and all its contents?
Bridger Dyson-Smith
bdysonsmith at gmail.com
Fri Sep 17 17:08:49 UTC 2021
Hi Chris
On Fri, Sep 17, 2021 at 1:01 PM Chris Green <cl at isbd.net> wrote:
> On Fri, Sep 17, 2021 at 03:23:22PM +0200, Pierre-Yves David wrote:
> > On 9/16/21 8:40 PM, Chris Green wrote:
> > > As per the subject, if I want to ignore a directory and all its
> > > contents and sub-directories what is the easiest way to do this in
> > > .hgignore?
> > >
> > > I'm assuming there is only one directory with the name I want to
> > > ignore.
> >
> > You can simply put the directory name in the hgignore, it should work.
> > (what's the directory name ?)
> >
> OK, thanks for this and the other replies. It wasn't absolutely clear
> to me from the documentation that directories can be excluded, all the
> .hgignore stuff talks about 'files'.
>
> So if I have a mercurial repository rooted at ~/doc I can put the
> following in ~/doc/.hgignore :-
>
> covid
>
> ... and both files and directories called 'covid' will be ignored.
>
> I think what you want would this:
syntax: glob
covid**
# ignores directories named "covid", "covid_19", etc
# ignores files named "covid", "covid.txt", "covid.bin", "covid.csv", etc
Here's an example:
bridger at ditrestle|/tmp/hg-test on default
± ls
README covid covid.csv covid_19/
bridger at ditrestle|/tmp/hg-test on default
± less .hgignore
syntax: glob
covid**
bridger at ditrestle|/tmp/hg-test on default
± hg st
A .hgignore
? README
--
> Chris Green
>
HTH
Best,
Bridger
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20210917/02a77077/attachment-0002.html>
More information about the Mercurial
mailing list