-->

funny that when .hgignore is added for Mercurial,

2019-06-28 09:04发布

问题:

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

回答1:

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.



回答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.