有趣的是,当为 Mercurial 添加 .hgignore 时,该文件本身显示为“?”汞状态?

发布于 2024-09-13 19:14:23 字数 55 浏览 3 评论 0原文

正常吗?那么您只需将 \.hgignore 添加到列表中即可忽略自身?

Is it normal? So you just need to add \.hgignore to the list to ignore itself?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

岛歌少女 2024-09-20 19:14:23

是的,但您不想忽略 .hgignore 文件。当新人查看您的存储库时,您不希望他们获得您的忽略文件列表吗?相反,执行 hg add .hgignore; hg 提交

底线:.hgignore 像存储库中的任何其他文件一样被跟踪。

Yes, but you don't want to ignore the .hgignore file. When a new person checks out your repository, don't you want them to get your ignored-files list? Instead, do hg add .hgignore; hg commit.

Bottom line: .hgignore is tracked like any other file in the repository.

如果没有你 2024-09-20 19:14:23

只是为了补充 Borealid 的答案:hg status 中的 ? 表示该文件位于工作目录中,但未被跟踪。您通常会在以下两种情况之一中看到它:

  1. 生成了不需要签入的文件,例如编译的二进制文件或其他文件。
  2. 您向项目中添加了一个新文件,但尚未对其进行 hg add 编辑。

在#1 中,您需要将文件或文件类型添加到.hgignore。在#2 中,您想要hg add 文件。对于.hgignore,它是#2。

Just to supplement Borealid's answer: ? in hg status means that the file is in the working directory, but not tracked. You usually see it in one of two situations:

  1. A file got generated that you don't need to check in, like a compiled binary or something.
  2. You added a new file to your project, but haven't hg added it yet.

In #1, you'll want to add the file or file type to .hgignore. In #2, you want to hg add the file. In the case of .hgignore, it's #2.

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