Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.hgignore directory "_notes" throughout repository tree?

I want to ignore all directories "_notes" throughout a repository. _notes is generated by dreamweaver and is not part of the project itself, but these directories are scattered throughout the project.

Somehow ^_notes$ is not doing the job in .hgignore ... Do I have to direct .hgignore to each and every directory "_notes" or does it do it recursively?

I am not quite sure about the man pages

like image 834
Subu Avatar asked Dec 07 '25 15:12

Subu


2 Answers

Try:

syntax: glob
_notes/*

I should probably mention that if the directories have already been added you cannot ignore them. Use hg forget if you are on a newer Mercurial version, be this the case.

like image 96
erisco Avatar answered Dec 10 '25 05:12

erisco


.hgignore

syntax: glob
_notes

This isn't specific to directories, so if you have any files with that exact name, they will be ignored too.

Example:

$ hg init subu && cd subu
$ mkdir _notes
$ mkdir a && mkdir a/_notes
$ echo 'syntax: glob' >>.hgignore
$ echo '_notes' >>.hgignore
$ touch file.txt
$ touch _notes/file.txt
$ touch a/file.txt
$ touch a/_notes/file.txt
$ hg st -A
? .hgignore
? a/file.txt
? file.txt
I _notes/file.txt
I a/_notes/file.txt

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!