1

I do a lot of development in Visual Studio. Can anyone point me at a good .hgignore file for all the usual bin / obj / dll / .csproj.user stuff?

flag

2 Answers

1

This one is high in google results:

http://stackoverflow.com/questions/4095696/mercurial-hgignore-for-visual-studio-2010-projects

But I find it to be flawed in a few ways (e.g. the [Dd]ebug*/ pattern will match /myproject/Debugger/something.cs which I want to check in). Here's mine. Please edit my answer or post better ones if you have 'em!

## use glob syntax
syntax: glob

**.suo
**.csproj.user
**/[Bb]in/**
**/[Oo]bj/**
link|flag
1 
Also see kiln.stackexchange.com/questions/2493/… – Ken Morse Nov 28 2011 at 23:33
1 
also kiln.stackexchange.com/questions/707/… – CADbloke Nov 29 2011 at 2:35
0

This is my latest which also ignores Git repos, just in case you're throwing caution to the wind and tracking code with both.


# Ignore file for Visual Studio 2008 / 2010 with some bits added by Ewen

# use glob syntax
syntax: glob

# Ignore Visual Studio 2008 files
*.*scc
*.FileListAbsolute.txt
*.aps
*.bak
*.[Cc]ache
*.clw
*.eto
*.exe
*.fb6lck
*.fbl6
*.fbpInf
*.ilk
*.lib
*.log
*.ncb
*.nlb
*.obj
*.patch
*.pch
*.pdb    
*.plg
*.[Pp]ublish.xml
*.rdl.data
*.sbr
*.scc
*.sig
*.sln.docstates
*.sqlsuo
*.suo
*.svclog
*.tlb
*.tlh
*.tli
*.tmp
*.user
*.vshost.*
*.vspscc
*DXCore.Solution
*_i.c
*_p.c
Ankh.Load
Backup*
CVS/
PrecompiledWeb/
UpgradeLog*.*
[Bb]in/
[Dd]ebug/
[Oo]bj/
[Rr]elease/
[Tt]humbs.db
_UpgradeReport_Files
_[Rr]e[Ss]harper.*/
hgignore[.-]*
ignore[.-]*
svnignore[.-]*
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml
TestResults\*
glob:desktop.ini 
*.bak.*
*.bak
tmp/
output
.git/
_svn/
packages/
git/
link|flag
I recommend against the post I linked to on stackoverflow because it's overly aggressive. e.g. it matches Something-Debug with the [Dd]ebug/ pattern. It looks like yours is based on that one. – adambox Jun 28 at 13:38
It is. Now that I look at it there are a few patterns that could catch you out - [Bb]in/ is probably even more troublesome. That said, I'm not likely to name a folder something-Debug. Good point though - always double-check. I generally clone to another folder / machine every now & then to make sure it's working ok. – CADbloke Jul 4 at 22:11

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.