Mercurial:在添加之前检查将添加哪些文件

发布于 2024-11-09 03:39:20 字数 88 浏览 0 评论 0原文

我想确保 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

女中豪杰 2024-11-16 03:39:20

顾名思义,“hg status”将显示文件的状态。

从“hg help status”中,

The codes used to show the status of files are:
M = modified
A = added
R = removed
C = clean
! = missing (deleted by non-hg command, but still tracked)
? = not tracked
I = ignored
  = origin of the previous file listed as A (added)

您还可以运行“hg add -n”,这是空运行,只会打印输出,但不会对存储库执行任何操作。

"hg status" will as the name implies show you the status of the files.

From "hg help status"

The codes used to show the status of files are:
M = modified
A = added
R = removed
C = clean
! = missing (deleted by non-hg command, but still tracked)
? = not tracked
I = ignored
  = origin of the previous file listed as A (added)

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.

演多会厌 2024-11-16 03:39:20

我同意 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文