문제

In the .gitignore syntax there is an option where you can have a ! at the beginning of the file and it will un-ignore any previously ignored files.

So I can have the following:

logs/*
!logs/stuff.txt

And logs/stuff.txt will still be tracked.

What is the Mercurial .hgignore equivalent for this?

도움이 되었습니까?

해결책

The equivalent is just adding the file. Once a file has been hg added the .hgignore file has absolutely no effect on how it's treated, so you ignore logs/* (be sure you're in glob mode, not regex mode) and then hg add logs/stuff.txt.

다른 팁

Using regexp syntax you can write both rules in one:

syntax: regexp
logs\/(?!stuff.txt$)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top