Skip to content

Instantly share code, notes, and snippets.

@mahdi
Created August 2, 2011 08:10
Show Gist options
  • Star 34 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save mahdi/1119793 to your computer and use it in GitHub Desktop.
Save mahdi/1119793 to your computer and use it in GitHub Desktop.
A .gitignore file for a .NET developer
#Junk Files
*.DS_Store
[Tt]humbs.db
#Visual Studio Files
[Oo]bj
[Bb]in
[Dd]ebug
[Bb]uild/
*.user
*.suo
*.exe
*.pdb
*.aps
*_i.c
*_p.c
*.ncb
*.tlb
*.tlh
*.[Cc]ache
*.bak
*.ncb
*.ilk
*.log
*.lib
*.sbr
*.sdf
ipch/
*.dbmdl
*.csproj.user
*.cache
*.swp
*.vspscc
*.vssscc
*.bak.*
*.bak
#Tools
_ReSharper.*
_ReSharper*/
*.resharper
*.resharper.user
[Nn][Dd]epend[Oo]ut*/
Ankh.NoLoad
#Other
.svn
# Include DLLs if they're in the NuGet packages directory
!/packages/*/lib/*.dll
!/packages/*/lib/*/*.dll
@cubny
Copy link

cubny commented Aug 2, 2011

New Folder

@mahdi
Copy link
Author

mahdi commented Aug 2, 2011

:-)

@SalmanAA
Copy link

SalmanAA commented Aug 2, 2011

App_Data folder, because of it replaces main database sometimes!

@jtwebman
Copy link

Nice Thanks!

@pontusm
Copy link

pontusm commented Aug 14, 2011

I believe that ignoring *.resharper files is actually wrong. Those file contains Resharper settings that everyone on the project should follow, such as formatting rules for instance.

@pontusm
Copy link

pontusm commented Aug 14, 2011

And in addition, you have excluded *.user which means that you don't need to also specify *.csproj.user and *.resharper.user :)

@mahdi
Copy link
Author

mahdi commented Aug 14, 2011

I have put *.resharper because some people in your team may not use ReSharper. In my own case we have some guys without ReSharper installed on their machines.

@pontusm
Copy link

pontusm commented Aug 14, 2011

Ok, but that file does no harm for those who do not have Resharper so I think it's perfectly fine to keep it in.

@mahdi
Copy link
Author

mahdi commented Aug 14, 2011

Maybe, but in my own experience, those team members who don't use ReSharper prefer to have a clean code directory without any extra files! Anyway, thank you for your feedback :-)

@paigecook
Copy link

This is a very nice .gitignore file. I have been using the one I outlined here: https://gist.github.com/1024746

Main differences are in the following sections:

  • packages
  • logs and databases
  • pro power tools
  • include of Nuget packages, as we like to have them in the repository.

@mahdi
Copy link
Author

mahdi commented Aug 16, 2011

@paigecook: Yours seems much more complete :-)

@arashkarami
Copy link

thanks

@sahinci
Copy link

sahinci commented Dec 18, 2012

*.dbmdl is in ignore list but vs2010 and git extesion still show it and not ignoring

@nakhli
Copy link

nakhli commented Feb 14, 2013

!/packages//lib/.dll doesn't seem to work.

@betobaz
Copy link

betobaz commented Apr 5, 2013

Other or (Git)

*.patch

@beginor
Copy link

beginor commented Apr 10, 2013

XamarinStudio(MonoDevelop) user prefs

*.userprefs

@vicentesuc
Copy link

vicentesuc commented Apr 1, 2020

if you are working on visual studio 2019 , dont forget add . in my case im developing using .net core

.vs/

@lavakeshpandey
Copy link

Cool, very helpful. Copied it.

@lavakeshpandey
Copy link

Can we also add .vscode files to gitignore? I think it won't be able to run the project when cloned but I guess vscode gives us an option to add assets to run/debug the program wherever it doesn't find one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment