hgignore:需要忽略除一个 .lib 文件之外的所有文件
对于我的班级项目,我的团队正在使用 hg 一起工作,我从 这个问题,有一些补充。但有一个问题。我有一个运行代码所需的 .lib 文件,我希望将其保存在存储库中。
由于 .hgignore 使用 glob 我也是,那么我如何允许文件 comp345_dnd/RollPlay.lib (根文件夹包含 comp345_dnd)进入/观看,而 *.lib 被忽略?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需手动对特定文件执行 hg add (不带任何通配符),例如:
这会覆盖 .hgignore 文件并将该文件添加到存储库。
Just manually do hg add on the specific file (without any wildcards) e.g.:
This overrides the .hgignore file and adds the file to the repository.
引用 Matt Mackall 关于 Mercurial-devel 列表的旧帖子:Mercurial 将添加在命令行上明确指定的任何文件,无论忽略规则如何。
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.