Mercurial 忽略除特定文件名之外的所有文件
我有一个大型文件系统,其中几乎每个文件夹都有一个名为 content.txt 的文件,
我想跟踪每个名为 content.txt 的文件并自动忽略其他所有文件。我希望存储库自动跟踪名为 content.txt 的新文件,因此我不想忽略 .hgignore 中的所有内容,然后手动添加。
有人知道该怎么做吗?
I have a large file system in which almost every folder has a file called content.txt
I want to track every file named content.txt and automatically ignore everything else. I want the repo to automatically track new files named content.txt so I don't want to ignore everything in the .hgignore and then manually add.
Anyone know how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
regexp 的路径部分,但“除 content.txt 之外的所有内容”草稿是re:.*\.(?!content.txt )
希望替代解决方案可以是
* 忽略所有
* 将 content.txt 文件模式添加到提交命令(-I 选项),请参阅
hg help commit
和hg help 模式
hg commit -I '**content.txt txt'
编辑
re:.*/(?!content.txt)
path-part of regexp, but "all except content.txt" draft isre:.*\.(?!content.txt)
as hopeAlternative solution can be
* ignore all
* add content.txt files pattern to commit command (-I option), see
hg help commit
andhg help patterns
hg commit -I '**content.txt'
Edit
re:.*/(?!content.txt)
试试这个:
我留下了我在实验时所做的评论,以理解这一切。 (这是第一个中的 glob 语法。)
Try this:
I left in the comments I made while experimenting, to make sense of it all. (That's glob syntax in the first one.)