简体   繁体   中英

Does 'hg add' ignore '.hgignore'?

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

To ignore, eg .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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM