Mercurial:在添加之前检查将添加哪些文件
我想确保 .htignore 中的正则表达式正常工作。在将文件添加到存储库之前,我想查看 hg add
命令将添加哪些文件。我该怎么做?
I want to make sure my regexp in .htignore are working correctly. Before adding files to the repository, I would like to see which files hg add
command would add. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
顾名思义,“hg status”将显示文件的状态。
从“hg help status”中,
您还可以运行“hg add -n”,这是空运行,只会打印输出,但不会对存储库执行任何操作。
"hg status" will as the name implies show you the status of the files.
From "hg help status"
You can also run "hg add -n" which is dry run and will only print the output but not do any thing to the repository.
我同意 NA 的答案,但还应该注意的是,您可以
hg add
任何内容,甚至是已被 .hgignore 过滤器忽略的文件。换句话说,如果您的 .hgignore 包含以下内容:glob:*.abc
,您仍然可以显式添加 *.abc 类型的文件。
I agree with NA's answer, but it should also be noted that you can
hg add
anything, even files that are already being ignored by the .hgignore filter. In other words, if your .hgignore contains this:glob:*.abc
you can still explicitly add files of type *.abc.