Home visual-studio What should be in gitignore for Visual Studio?

What should be in gitignore for Visual Studio?

Author

Date

Category

I create a project in Visual Studio , copy .gitignore taken to the root directory of the project from here .

Under version control, I add the following files:

  • Classes, Interfaces
  • .gitignore

Actually the question is whether it is necessary to add other files to the version control system?

For example:

  • Properties \ AssemblyInfo.cs
  • Project.csproj
  • Solution_Name.sln
  • Other files

Answer 1, authority 100%

You don’t need to add * .sln to .gitignore . In the files sln studio stores the structure of the project and links between elements. If you later roll back to an earlier commit, then this will puzzle the studio a lot, it will have to rebuild connections. Therefore, they need to be committed along with other files.

Just in case, I’ll leave a copy of the current state here .gitignore from github :

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
* .suo
* .user
* .userosscache
* .sln.docstates
# User-specific files (MonoDevelop / Xamarin Studio)
* .userprefs
# Build results
[Dd] ebug /
[Dd] ebugPublic /
[Rr] elease /
[Rr] eleases /
x64 /
x86 /
build /
bld /
[Bb] in /
[Oo] bj /
# Visual Studio 2015 cache / options directory
.vs /
# Uncomment if you have tasks that create the project's static files in wwwroot
# wwwroot /
# MSTest test Results
[Tt] est [Rr] esult * /
[Bb] uild [Ll] og. *
# NUNIT
* .VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd] ebugPS /
[Rr] eleasePS /
dlldata.c
# DNX
project.lock.json
artifacts /
* _i.c
* _p.c
* _i.h
* .ilk
* .meta
* .obj
* .pch
* .pdb
* .pgc
* .pgd
* .rsp
* .sbr
* .tlb
* .tli
* .tlh
* .tmp
* .tmp_proj
* .log
* .vspscc
* .vssscc
.builds
* .pidb
* .svclog
* .scc
# Chutzpah Test files
_Chutzpah *
# Visual C++ cache files
ipch /
* .aps
* .ncb
* .opendb
* .opensdf
* .sdf
* .cachefile
# Visual Studio profiler
* .psess
* .vsp
* .vspx
* .sap
# TFS 2012 Local Workspace
$ tf /
# Guidance Automation Toolkit
* .gpState
# ReSharper is a .NET coding add-in
_ReSharper * /
*. [Rr] e [Ss] harper
* .DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity *
# DotCover is a Code Coverage Tool
* .dotCover
# NCrunch
_NCrunch_ *
. * crunch * .local.xml
nCrunchTemp_ *
# MightyMoose
* .mm. *
AutoTest.Net/
# Web workbench (sass)
.sass-cache /
# 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
*. [Pp] ublish.xml
* .azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
* .pubxml
* .publishproj
# NuGet Packages
* .nupkg
# The packages folder can be ignored because of Package Restore
** / packages / *
# except build /, which is used as an MSBuild target.
! ** / packages / build /
# Uncomment if necessary however generally it will be regenerated when needed
#! ** / packages / repositories.config
# Windows Azure Build Output
csx /
* .build.csdef
# Windows Azure Emulator
ecf /
rcf /
# Windows Store app package directory
AppPackages /
# Visual Studio cache files
# files ending in .cache can be ignored
*. [Cc] ache
# but keep track of directories ending in .cache
! *. [Cc] ache /
#Others
ClientBin /
[Ss] tyle [Cc] op. *
~ $ *
* ~
* .dbmdl
* .dbproj.schemaview
* .pfx
* .publishsettings
node_modules /
orleans.codegen.cs
# RIA / Silverlight projects
Generated_Code /
# Backup & amp; 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 * /
UpgradoLog * .xml
UpgradoLog * .htm.
# SQL Server Files
* .mdf.
* .ldf.
# Business Intelligence Projects
* .rdl.data.
* .bim.Layout
* .bim _ *. settings
# Microsoft Fakes.
Fakesassemblies /
# Ghostdoc Plugin Setting File
* .Ghostdoc.xml.
# NODE.JS Tools for Visual Studio
.ntvs_analysis.dat.
# Visual Studio 6 Build Log
* .plg.
# Visual Studio 6 Workspace Options File
* .opt.
# Visual Studio Lightswitch Build Output
** / *. HTMLCLIENT / GENEREDARTATIFACTS
** / *. DesktopClient / GeneratedArtifacts
** / *. DesktopClient / Modelmanifest.xml
** / *. Server / GenerateDartifacts
** / *. Server / Modelmanifest.xml
_PVT_Extensions
# PAKET DEPENDENCY MANAGER
.paket / packet.exe
# Fake - F # make
.fake /

Answer 2, Authority 25%

maybe someone useful to generate service to generate .gitignore in language, Freymwork, IDE – https : //www.gitignore.io/

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions