I am looking for an expression for the .hgignore file, to ignore all files beneath a specified folder.
eg: I would like to ignore all files and folders beneath bin
Actually any advice on how the expressions are formed would be great
I am looking for an expression for the .hgignore file, to ignore all files beneath a specified folder.
eg: I would like to ignore all files and folders beneath bin
Actually any advice on how the expressions are formed would be great
Alternately:
syntax: glob
bin/**
bin
bin/
bin/*
bin/**
- All do the same thing with glob i.e. ignore all directories & sub-directories named bin but not any file name bin.txt or bin1 . What's the point of asterix? –
Cauda re
sort of guy) –
Excellent bin
, it seams to be special. I can have the correct pattern and it does not work, I then use another pattern (Debug
the only subdirectory) and the directory is ignored, then switch back to the correct one and all is ok. I have no idea where this memory is coming from. –
Chrysoprase I did some experiments and I found that the regex syntax on Windows applies to the path starting with the current repository, with backslashes transformed to slashes.
So if your repository is in E:\Dev for example, hg status
will apply the patterns against foo/bar/file1.c and such. Anchors apply to this path.
So:
I hope this will help, I found the HGIGNORE(5) page a bit succinct.
Both of those will also filter out a directory called cabin
, which might not be what you want. If you're filtering top-level, you can use:
^/bin/
For bin
directories below your root, you can omit the ^. There is no need to specify syntax, regexp is the default.
syntax: glob bin/**
This answer is shown above, however I'd also like to add that * and ** are handled differently. ** is recursive, * is not.
See Hg Patterns
Nevermind, I got it
syntax: regexp
bin\\*
expressions follow standard perl regular expression syntax.
© 2022 - 2024 — McMap. All rights reserved.