What should I put in hgignore to avoid mercury by following the contents of the subdir?

For example, I have a folder

PROJECT/db/

Where many files are created, I want hg not to keep track of these files, but to keep the db folder?

+3
source share
2 answers

Empty folders are not supported by default in mercurial, so if you ignore all the files in a folder, the folder will not be tracked.

From the hg book: http://hgbook.red-bean.com/read/mercurial-in-daily-use.html

, , . Mercurial, , , , , , .

, . - , hg "" . Unix- , ( "." ), . .

$ hg init hidden-example
$ cd hidden-example
$ mkdir empty
$ touch empty/.hidden
$ hg add empty/.hidden
$ hg commit -m 'Manage an empty-looking directory'
$ ls empty
$ cd ..
$ hg clone hidden-example tmp
updating working directory
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ ls tmp
empty
$ ls tmp/empty

- , .

Edit: , , hgignore , :
.hgignore . :

syntax: glob
db/
+5

, Mercurial , , , DB.

0

Source: https://habr.com/ru/post/1758836/


All Articles