<p>What is a good setup for .hgignore file when working with Visual Studio 2008?</p>

<p>I mostly develop on my own, only occasionly I clone the repository for somebody else to work on it.</p>

<p>I'm thinking about obj folders, .suo, .sln, .user files etc.. Can they just be included or are there file I shouldn't include?</p>

<p>Thanks!</p>

<p>p.s.: at the moment I do the following : ignore all .pdb files and all obj folders.</p>

<pre><code># regexp syntax.
syntax: glob
*.pdb

syntax: regexp
/obj/
</code></pre>

[{'answer_id': 34805, 'author': 'Daniel Jennings', 'author_id': 3641, 'author_profile': 'https://Stackoverflow.com/users/3641', 'pm_score': 5, 'selected': False, 'text': "<p>This is specific to a C# project, but I ignore these files/directories:</p>\n\n<blockquote>\n  <ul>\n  <li><code>*.csproj.user</code></li>\n  <li><code>/obj/*</code></li>\n  <li><code>/bin/*</code></li>\n  <li><code>*.ncb</code></li>\n  <li><code>*.suo</code></li>\n  </ul>\n</blockquote>\n\n<p>I have no problems running the code in the depot on other machines after I ignore all of these files. The easiest way to find out what you need to keep is to make a copy of the folder and start deleting things you think aren't necessary. Keep trying to build, and as long as you can build successfully keep on deleting. If you delete too much, copy it from the source folder.</p>\n\n<p>In the end you'll have a nice directory full of the only files that have to be committed.</p>\n"}, {'answer_id': 226447, 'author': 'jm.', 'author_id': 814, 'author_profile': 'https://Stackoverflow.com/users/814', 'pm_score': 4, 'selected': False, 'text': '<p>Here is the content of my .hgignore for C# Visual Studio projects:</p>\n\n<pre><code>syntax: glob\n*.user\n*.ncb\n*.nlb\n*.suo\n*.aps\n*.clw\n*.pdb\n*\\Debug\\*\n*\\Release\\*\n</code></pre>\n\n<p>A few notes:</p>\n\n<ol>\n<li>If you have custom "releases"\nbesides "Debug" and "Release", you\nmay need to add them. </li>\n<li>Be careful when you manually edit your\n.hgignore. If you make a syntax\nerror, then hgtortoise will no\nlonger open the commit dialog.</li>\n</ol>\n'}, {'answer_id': 744333, 'author': 'Even Mien', 'author_id': 73794, 'author_profile': 'https://Stackoverflow.com/users/73794', 'pm_score': 9, 'selected': True, 'text': "<p>Here's my standard .hgignore file for use with VS2008 that was originally modified from a Git ignore file:</p>\n\n<pre><code># Ignore file for Visual Studio 2008\n\n# use glob syntax\nsyntax: glob\n\n# Ignore Visual Studio 2008 files\n*.obj\n*.exe\n*.pdb\n*.user\n*.aps\n*.pch\n*.vspscc\n*_i.c\n*_p.c\n*.ncb\n*.suo\n*.tlb\n*.tlh\n*.bak\n*.cache\n*.ilk\n*.log\n*.lib\n*.sbr\n*.scc\n[Bb]in\n[Dd]ebug*/\nobj/\n[Rr]elease*/\n_ReSharper*/\n[Tt]est[Rr]esult*\n[Bb]uild[Ll]og.*\n*.[Pp]ublish.xml\n</code></pre>\n"}, {'answer_id': 2294025, 'author': 'AlGonzalez', 'author_id': 276368, 'author_profile': 'https://Stackoverflow.com/users/276368', 'pm_score': 3, 'selected': False, 'text': '<p>My Mercurial .hgignore file contents:</p>\n\n<pre><code>syntax: glob\n#-- Files\n*.bak.*\n*.bak\nthumbs.db\n\n#-- Directories\nApp_Data/*\nbin/\nobj/\n_ReSharper.*/\ntmp/\n\n#-- Microsoft Visual Studio specific\n*.user\n*.suo\n\n#-- MonoDevelop specific\n*.pidb\n*.userprefs\n*.usertasks\n</code></pre>\n\n<p>Keep in mind that I mainly work on WinForms, ASP.NET MVC and Mobile projects using Microsoft Visual Studio and occasionally MonoDevelop. Depending on your toolset and project types, you will probably encounter other files that should be ignored.</p>\n\n<p>I try to keep the latest version on CodePaste.NET at <a href="http://codepaste.net/zxov7i" rel="noreferrer">http://codepaste.net/zxov7i</a></p>\n'}, {'answer_id': 2555413, 'author': 'Damian Powell', 'author_id': 30321, 'author_profile': 'https://Stackoverflow.com/users/30321', 'pm_score': 5, 'selected': False, 'text': "<p>I feel left out of the conversation. Here's my .hgignore file. It covers C#, C++ and Visual Studio development in general, including COM stuff (type libraries), some final builder files, CodeRush, ReSharper, and Visual Studio project upgrades. It also has some ignores for modern (c.2015) web development.</p>\n\n<pre><code>syntax: glob\n\n* - [Cc]opy\n* - [Cc]opy/\n* - [Cc]opy (?)/\n* - [Cc]opy.*\n* - [Cc]opy (?).*\n**/.*\n**/scss/*.css\n*.*scc\n*.FileListAbsolute.txt\n*.aps\n*.bak\n*.bin\n*.[Cc]ache\n*.clw\n*.css.map\n*.eto\n*.exe\n*.fb6lck\n*.fbl6\n*.fbpInf\n*.ilk\n*.lib\n*.log\n*.ncb\n*.nlb\n*.nupkg\n*.obj\n*.old\n*.orig\n*.patch\n*.pch\n*.pdb\n*.plg\n*.[Pp]ublish.xml\n*.rdl.data\n*.sbr\n*.scc\n*.sig\n*.sqlsuo\n*.suo\n*.svclog\n*.tlb\n*.tlh\n*.tli\n*.tmp\n*.user\n*.vshost.*\n*.docstates\n*DXCore.Solution\n*_i.c\n*_p.c\n__MVC_BACKUP/\n_[Rr]e[Ss]harper.*/\n_UpgradeReport_Files/\nAnkh.Load\nBackup*\n[Bb]in/\nbower_components/\n[Bb]uild/\nCVS/\n[Dd]ebug/\n[Ee]xternal/\nhgignore[.-]*\nignore[.-]*\nlint.db\nnode_modules/\n[Oo]bj/\n[Pp]ackages/\nPrecompiledWeb/\n[Pp]ublished/\n[Rr]elease/\nsvnignore[.-]*\n[Tt]humbs.db\nUpgradeLog*.*\n</code></pre>\n"}, {'answer_id': 2578567, 'author': 'rohancragg', 'author_id': 5351, 'author_profile': 'https://Stackoverflow.com/users/5351', 'pm_score': 2, 'selected': False, 'text': '<p>some others I use:</p>\n\n<pre><code>output\nPrecompiledWeb\n_UpgradeReport_Files\n\n#Guidance Automation Toolkit\n*.gpState\n#patches\n*.patch\n</code></pre>\n'}, {'answer_id': 7798061, 'author': 'Nathan Donnellan', 'author_id': 997216, 'author_profile': 'https://Stackoverflow.com/users/997216', 'pm_score': 2, 'selected': False, 'text': "<p>Here are a couple pesky ones: Matlab and Excel/Office autosaves.</p>\n\n<pre><code># use glob syntax\nsyntax: glob\n\n# Matlab ignore files\n*.asv\n\n# Microsoft Office\n~$*\n</code></pre>\n\n<p>If I accidentally add them and then close the real file that was open, Excel and/or Matlab will delete the auto-save and then Mercurial will be stuck wondering where they went. I'm sure there are other programs that do similar things.</p>\n"}]
['https://Stackoverflow.com/questions/34784', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/925/']