hasManyStupidQuestions
hasManyStupidQuestions

Reputation: 273

Does 'hg add' ignore '.hgignore'?

I am new to Mercurial, having used Git previously. I believe I am using Mercurial incorrectly.

To ignore, e.g. .DS_Store, with git, one would add .DS_Store to .gitignore. Then if one did git add -A, git still wouldn't track .DS_Store.

However, after adding .DS_Store to .hgignore, and then doing hg forget .DS_Store, hg add adds .DS_Store back, as can be confirmed via hg status. The same problem even happens after doing hg forget "set:hgignore()".

Question: What am I doing wrong?

Upvotes: 0

Views: 115

Answers (1)

hasManyStupidQuestions
hasManyStupidQuestions

Reputation: 273

This was a stupid question, since I just figured out the answer. Since I couldn't find the answer on Google or StackOverflow, I will post it here. If this question is a duplicate, please just delete it (without insulting me).

Anyway the answer is that I hadn't done hg commit yet. After doing hg forget .DS_Store and then a hg commit, hg add no longer re-adds .DS_Store, since it is located in .hgignore.

Upvotes: 1

Related Questions