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?
Here's an extract from a
.gitignore
on a recent project I was working on. I've extracted the ones that I believe are related to Visual Studio, including the compilation outputs; it's a cross platform project, so there are various other ignore rules for files produced by other build systems, and I can't guarantee that I separated them out exactly.Perhaps this question should be Community Wiki, so we can all edit together one master list with comments about which files should be ignored for which types of project?
See the official GitHub's "Collection of useful .gitignore templates".
The
.gitignore
for Visual Studio can be found here:https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
Late to the party here, but I also find that I use the following. Some may only be useful for hiding sensitive files when pushing to a public remote.
I understand this is an old question, still sharing an information. In Visual Studio 2017, you can just right click on the solution file and select Add solution to source control
This will add two files to your source folder.
This is the easiest way I guess.
For those interested in what Microsoft thinks should be included in the gitignore, here's the default one which
Visual Studio 2013 RTM
automatically generates when creating a new Git-Repository:See: Add a default .gitignore file on MSDN
In Visual Studio 2015 Team Explorer > Local Git Repositories > Project > Settings > Git > Repository Settings > Ignore & Attribute Files.You can add .gitignore file with items should be ignored in visual studio solutions by default.