Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Mercurial (Hg) to add new files automatically

I'm looking for the opposite mechanism to the .ignore file, which should add all files of a given pattern automatically, for example *.tex for any LaTeX documentation project or *.def for any file that was added by OASIS (an MS Access addin for version control).

like image 837
Christoph Jüngling Avatar asked Oct 13 '11 14:10

Christoph Jüngling


2 Answers

hg add with no arguments will add all files not explicitly ignored. You can also use hg commit --addremove to add all unknown files (and remove all deleted files, i.e. hg rm any which hg status lists as '!') to do this automatically when committing.

like image 93
Kevin Avatar answered Sep 30 '22 18:09

Kevin


Adding files only happens when you run hg add. If you want to add all files matching a pattern, use the --include (-I) switch.

like image 21
Cat Plus Plus Avatar answered Sep 30 '22 20:09

Cat Plus Plus