What are your best practices for Git with .Net? What files do you ignore and do not add to your project type?
5 Answers
An initial list excludes all temporary build files,
*.dep *.aps *.vbw *.suo *.obj *.ncb *.plg *.bsc *.ilk
*.exp *.sbr *.opt *.pdb *.idb *.pch *.res *.user
Also the build directories
*\obj
*\bin
*\Debug
*\Release
if you use Rehsarper, exclude its directories too
./Resharp*
Plus some special files
Thumbs.db
Some people also exclude binary files
*.exe
*.dll
It might be worthwhile considering what you want to store in your SCM, rather than a long and possibly never-complete list of exclusions.

- 51,617
- 12
- 104
- 148
-
7Don't exclude *.dll* if you have 3rd party assemblies in your project though :) – Svish Aug 17 '09 at 12:32
-
.user and .suo aren't temporary build files. Additionally, build and binary files are automatically excluded if you ignore obj and bin, which makes for a much shorter ignore list. In .NET solutions, there's no reason to exclude Debug and Release, since both reside in obj/bin, which should be ignored anyway. And ignoring the thumbs.db is, in my opinion, a bit strange since they are simply not there on newer systems (XP legacy). +1 though for the Resharper and the final advice. – OregonGhost Aug 18 '09 at 09:05
This is not really git-specific, but rather applies to any version control.
Ignore the bin and obj folders, and the .user and .suo files (which are user-specific). That is, of course, if you're using Visual Studio.

- 23,359
- 7
- 71
- 108
I use this as a template for all my .net git repos: .gitignore Gist for .net

- 1,223
- 12
- 15
I exclude all binary and source files that the Visual Studio doesn't need in order to rebuilt the application.
I'm not sure if all VS versions have the same file extensions, but you can experiment if you like.
Eric Sink has a guide for source control, Source Control HOWTO, and in Chapter 4: Repositories, you can read What can be stored in a repository? section, which is related to your question.

- 42,588
- 16
- 104
- 136
I don't use Git, but I do ignore files!
bin obj *.user *.suo *.log *.vbw *.pdb *mdf *ldf
_UpgradeReport* UpgradeLog* _ReSharper* *.resharper

- 4,053
- 1
- 28
- 29