문제

I use NuGet for package management on my .NET projects and one thing that happens consistently is that the package.config files get ignored for commit unless I explicitly add them. With any other file that is not specifically filtered by my .hgignore TortoiseHg suggests it be included in the commit dialog.

The contents of my .hgignore is this:

# Ignore file for Visual Studio 2008

# use glob syntax
syntax: glob

# Ignore Visual Studio 2008 files
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.lib
*.sbr
*.scc
*.orig
[Bb]in
[Dd]ebug*/
obj/
[Rr]elease*/
build*/
_ReSharper*/
[Pp]ackages*/
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml
Thumbs.db
desktop.ini

I see the None of this is tragic, just a bit of friction. Any thoughts as to why the package.config is being ignored?

Edit: OK I see the line that is likely responsible: [Pp]ackages*/ I think then the question is what pattern do I need that will filter out my packages directories, but let packages.config through? My regex is not so good so any help is appreciated.

도움이 되었습니까?

해결책

Delete [Pp]ackages*/ from glob section and add regexp-section with negative lookahead for package.config (TBT!):

syntax: regex
^packages.*/(?!package\.config$)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top