hgignore: need to ignore all but one .lib file
Asked Answered
U

2

7

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?

Ultimate answered 6/11, 2011 at 1:48 Comment(0)
T
14

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.

Trophozoite answered 6/11, 2011 at 1:58 Comment(1)
No - the .hgignore only operates when you're specifying directories or patterns. If you tell mercurial to add a specific real file, it does it, and then continues to track it, regardless of .hgignore.Trophozoite
U
2

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.

Ugaritic answered 7/11, 2011 at 21:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.