문제

I'm trying to make mercurial ignore the "1.txt" file in win7, mercurial 2.3

Why is 1.txt still shown with the "hg status" command here?

\hgtest> dir


Directory: \hgtest


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----        2012-08-27     11:01            .hg
-a---        2012-08-27     11:03         44 .hgignore
-a---        2012-08-27     11:02          6 1.txt


\hgtest> type .hgignore
syntax: glob
*.txt
\hgtest> hg status
? .hgignore
? 1.txt
도움이 되었습니까?

해결책

I suspect it is because your .hgignore is in utf-16 encoding. Thereof the size 44 for a 22 character text.

hg probably don't understand the .hgignore file.

Try opening the file and save it in plain ANSI encoding.

다른 팁

Probably because it's still in the repository. Try to forget that file. If you want to have this file in the repository, and at the same time ignore it, that it does not show, I think that this is not possible.

I just tried recreating your scenario based on the information in your original question on 64-bit Windows 7, but with Mercurial 2.2.3 (I am using TortoiseHg 2.4.2) and I don't see this problem. I checked both in a cmd.exe console and a Powershell console (which is what you appear to be using). I noticed, that the reported size of the .hgignore file in my case was half of what it was in your original question. I am not sure what the difference in size is because of. Since we are on different versions of Mercurial, I wonder if something broke in 2.3.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top