Mahdi Taghizadeh I'm who I'm!

14Aug/115

A .gitignore File for .NET Developers

It’s a few weeks that I have started to move my projects over to Git. You’ve certainty heard a lot about this DVCS and its advantages and in this post I’m not gonna enter this area of pros and cons.

As I’m a .NET developer, working with Visual Studio and other related tools from Microsoft and other community companies I needed to customize .gitignore file to include some .NET-specified rules to prevent painful conflicts while working as a team. I found some resources on the community and tried to merge them all and create “A .gitignore File for .NET Developers” and shared it on Gist so that everyone else can grab it and add to his project controlled by Git.

You can view and download this .gitignore file here.

Also, I would be appreciated if you leave your suggestion as a comment so that I can complete the rules to cover more general cases.

Comments (5) Trackbacks (2)
  1. Thanks for sharing. A couple of questions:

    - why are *.DS_Store and [Tt]humbs.db listed twice?
    - doesn’t *.user take care of *.resharper.user and *.csproj.user?

  2. Here is a copy of my .gitignore http://codepaste.net/fca8po – I’ll be comparing them for ideas.

  3. Here is mine:

    #OS junk files
    [Tt]humbs.db
    *.DS_Store

    #Visual Studio files
    *.[Oo]bj
    *.exe
    *.pdb
    *.user
    *.aps
    *.pch
    *.vspscc
    *.vssscc
    *_i.c
    *_p.c
    *.ncb
    *.suo
    *.tlb
    *.tlh
    *.bak
    *.[Cc]ache
    *.ilk
    *.log
    *.lib
    *.sbr
    *.sdf
    ipch/
    obj/
    [Bb]in
    [Dd]ebug*/
    [Rr]elease*/
    [Nn][Dd]epend[Oo]ut*/
    Ankh.NoLoad

    #Tooling
    _ReSharper*/
    *.resharper
    [Tt]est[Rr]esult*

    #Project files
    [Bb]uild/

    #Subversion files
    .svn

    # Office Temp Files
    ~$*

    visual-studio git

  4. @Keyvan:
    Thank you! I completed mine and also categorized as you’ve suggested.

  5. @Al:

    Yes! Thank you for your attention. I removed redundant entries.


Leave a comment