Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hgignore: need to ignore all but one .lib file

For my class project my team is using hg to work together and I made the ignore file from the checked answer on from this question, with a few additions. There's a problem though. I have a .lib file necessary to making the code run and I want it kept in the repository.

Since that .hgignore is using glob I am too, so how would I allow the file comp345_dnd/RollPlay.lib (root folder contains comp345_dnd) to be in/watched while *.lib is ignored?

like image 656
Portaljacker Avatar asked Nov 06 '11 01:11

Portaljacker


2 Answers

Just manually do hg add on the specific file (without any wildcards) e.g.:

hg add /path/to/file

This overrides the .hgignore file and adds the file to the repository.

like image 74
asc99c Avatar answered Nov 13 '22 21:11

asc99c


to quote Matt Mackall in an old post on the mercurial-devel list: Mercurial will add any -files- explicitly specified on the command line, regardless of the ignore rules.

like image 2
smooth reggae Avatar answered Nov 13 '22 20:11

smooth reggae