Mercurial: a few .hgignore related questions

I have been working with a .hgignore file for a long time, which was beautiful and recently added one new file type to ignore. When running "hg status" I noticed this:

 M .hgignore 

So, Mercurial believes that .hgignore is the file that needs to be tracked (if this is the root of the project).

Now I read various documents, but my points were not specifically addressed, so here are some very detailed questions that I hope can help me understand this (it would be great that someone who answers can quote and solve these three points [even with a simple yes / no answer for each question]):

  • Should .hgignore be at the root of the project? (I think it should have seen that a developer could potentially work on several projects that would have different .hgignore requirements)

  • Is it possible to ignore .hgignore as Mercurial?

  • If it can be ignored, should .hgignore ignore Mercurial (which is different from the previous question)

In the case when .hgignore should not be ignored, could there be something really bad if you suddenly rolled back earlier when you used a really old and incomplete .hgignore ?

I think I saw strange things related to specific IDE project files for each user (I am not saying that all IDE project files are for only one user, but some of them) that should have been ignored, but then the user returns to the old version, where the old .hgignore , and then files that should be ignored are suddenly ignored because the old .hgignore did not exclude them.

+6
dvcs mercurial hgignore
source share
1 answer

You usually ignore the .hgignore file because you want it to be part of the repository, so all your users end it.

As for skating far back and then accidentally committing files, you shouldn't - well, it can really happen anyway. Be sure to responsibly.

To your other questions:

  • Yes, .hgignore should be at the root of the repository.
  • Yes .hgignore can ignore itself.
  • No, .hgignore should not be ignored (unless you decide that you do not want it in the repository).
+13
source share

All Articles