funny that when .hgignore is added for Mercurial, this file itself shows up as “?” in hg status?

馋奶兔 提交于 2019-12-10 15:13:39

问题


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.



来源:https://stackoverflow.com/questions/3472866/funny-that-when-hgignore-is-added-for-mercurial-this-file-itself-shows-up-as

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!