问题
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:
- A file got generated that you don't need to check in, like a compiled binary or something.
- You added a new file to your project, but haven't
hg add
ed 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.
来源:https://stackoverflow.com/questions/3472866/funny-that-when-hgignore-is-added-for-mercurial-this-file-itself-shows-up-as