Git ignore file for VB.NET projects

12,509

Solution 1

Here's what I have for my C# projects:

ProjectName/bin
ProjectName/obj
*.user
*.suo
_ReSharper.*
*.sln.cache

With the bin/obj directories gone, you don't need to exclude all EXEs, XML files etc - which is handy, as it means you still get to put in the ones you want :) (You might have sample XML files etc.)

Solution 2

We use the following, all of our shared stuff (dll, exe, bat, etc) are kept in a a folder named "lib", this way it stays clean and we can put anything we want in lib and it is excluded from the ignore rules.

[Bb]in/
[Oo]bj/
!/lib
*.user
*.suo
_ReSharper.*
*.sln.cache
*.xap
*.vspcc
*.vscc 
*.vssscc

BTW, yes .gitignore is case sensitive even in Windows, so yes you need to include multiple cases. Visual Studio will sometimes create a Bin folder instead of bin if you are working with Silverlight or WPF applications. The same applies for Obj. Some external tools will do that as well. The extension names, from what I have been able to tell, are lowercase in all cases, unless of course you modify it (another hack if you want to remove a single file from the git add . command, BTW).

Solution 3

maintained here: https://github.com/github/gitignore

# Build and Object Folders
bin/
obj/

#User Specific Files
*.user
*.suo

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Rr]elease/
x64/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
*.vssscc
.builds

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder 
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Publish Web Output
*.Publish.xml

# Others
[Bb]in
[Oo]bj
sql
TestResults
[Tt]est[Rr]esult*
*.Cache
ClientBin
[Ss]tyle[Cc]op.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML

Solution 4

Delete the existing .scc files. They're Source Safe junk.

You'll also want to exclude: .licx (license files,) .dll, .suo, .ncb, .vspcc, .vscc, and .vssscc files. The last three are generated by Visual Studio to keep track of source control bindings.

Share:
12,509
Raul Silveira Bento
Author by

Raul Silveira Bento

Updated on June 03, 2022

Comments

  • Raul Silveira Bento
    Raul Silveira Bento almost 2 years

    I wan to place a VB.NET project under Git control in Windows (was previously under Visual Source Safe - long sad story of repository corruption, etc.). How should I set up the ignore file? The exclusions I'm thinking of using are:

    • *.exe
    • *.pdb
    • *.manifest
    • *.xml
    • *.log (is Git case sensitive on Windows? Should I exclude *.l og as well?)
    • *.scc (I gather these were left over from Visual Source Safe - maybe I should delete them?)

    Is this a sensible list? Should I be excluding directories?

  • Jon Skeet
    Jon Skeet over 15 years
    Don't exclude DLLs - you'll want to include any libraries you reference (NUnit etc).
  • joshperry
    joshperry over 13 years
    Great list, one problem I had was with some projects which I hadn't created a directory for the solution so the bin and obj directories were in the same directory as the .gitignore file. I ended up using [Bb]in/ and [Oo]bj/ for the rules to catch both locations as well as case differences.