A .NET (C#) Developer’s .gitignore File

As a recent convert to the awesomeness that is git (my current flavor is msysgit), I find myself continuously needing to update the .gitignore file that I copy and paste between my repositories. Here’s what my ignore file currently contains:












The “~$*” line is for MS Office temp files. Other than that, it’s a pretty common list of files and folders that .NET (C#) developers would want to ignore in the git repositories.

What does your .gitignore file look like? What am I missing from mine?

About Derick Bailey

Derick Bailey is an entrepreneur, problem solver (and creator? :P ), software developer, screecaster, writer, blogger, speaker and technology leader in central Texas (north of Austin). He runs SignalLeaf.com - the amazingly awesome podcast audio hosting service that everyone should be using, and WatchMeCode.net where he throws down the JavaScript gauntlets to get you up to speed. He has been a professional software developer since the late 90's, and has been writing code since the late 80's. Find me on twitter: @derickbailey, @mutedsolutions, @backbonejsclass Find me on the web: SignalLeaf, WatchMeCode, Kendo UI blog, MarionetteJS, My Github profile, On Google+.
This entry was posted in Git. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • If you use monodevelop add:


    and if you have 3rd party components with bad licensing tech, you will want to ignore also


  • another tip – you can do a “global” .gitignore with git config, but that won’t work on a shared repo. However, you can save a stock .gitignore in some root folder (i keep mine in ~/code) and then alias the “git init” or “git clone” commands to include copying that .gitignore to the local dir

  • StyleCop.Cache if you use StyleCop.

  • Alexey Abramov

    This is global svn ignore pattern of our team (.Net developers + some Dreamweaver users). Thanks for sharing!


  • If you use a file-based DB or file-based logs, you may want to account for those too. In my case I very often have machine-specific config settings that go in a file that I don’t want in the repo.

  • mendicant

    If I’m not mistaken, the *.resharper will kill solutionwide settings for resharper (if you’re using them).

  • Awesome.

    Surely, this belongs in a gist :)


    Mine is very similar…


  • @tobin,

    good call! :)

    @everyone else,

    thanks everyone! the input is greatly appreciated, and appears to be helping a good number of people already (based on page views, google search results, etc)

  • You should create a GitHub account and place this file there so you can reference it at any time. That and you can share it with the community.

  • @joe,

    done… a month ago. :)