Which files should I include in .gitignore
when using Git in conjunction with Visual Studio Solutions (.sln
) and Projects?
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- VS2017 RC - The following error occurred when tryi
相关文章
- 请教Git如何克隆本地库?
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
Added InstallShield ignores for the build deployment. InstallShield is the new direction Microsoft is headed over Visual Studio Installer, so we've started using it on all new projects. This added line removes the SingleImage installation files. Other InstallShield types may include DVD distribution among others. You may want to add those directory names or just [Ee]xpress/ to prevent any InstallShield LE deployment files from getting into the repo.
Here is our .gitignore for VS2010 C# projects using Install Shield LE with SingleImage deployments for the installer:
If you are using a dbproj in your solution you will want to add the following:
Source: http://blogs.msdn.com/b/bahill/archive/2009/07/31/come-visit-revisit-the-beer-house-continuous-integration.aspx
On Visual Studio 2015 Update 3, and with Git extension updated as of today (2016-10-24), the .gitignore generated by Visual Studio is:
While you should keep your NuGet packages.config file, you should exclude the packages folder:
I typically don't store binaries, or anything generated from my source, in source control. There are differing opinions on this however. If it makes things easier for your build system, do it! I would however, argue that you are not versioning these dependencies, so they will just take up space in your repository. Storing the binaries in a central location, then relying on the packages.config file to indicate which version is needed is a better solution, in my opinion.
I use the following .gitignore for C# projects. Additional patterns are added as and when they are needed.
I prefer to exclude things on an as-needed basis. You don't want to shotgun exclude everything with the string "bin" or "obj" in the name. At least be sure to follow those with a slash.
Here's what I start with on a VS2010 project:
And only because I use ReSharper, also this: