我支持许多使用Subversion来控制他们工作的.Net开发人员,但是我们遇到了许多似乎围绕Visual Studio用来管理项目,调试的其他文件的问题等等。具体来说,似乎这些文件由于它们已经在回购中而导致冲突。我知道如何解决它们以及如何处理它们,但我需要知道“它们”是什么。
那么,Subversion可以忽略哪些文件/目录,以及为什么可以忽略它们?(也就是说这些文件做了什么?)
这是一个庞大的,相当无组织的ASP.Net站点,部署该站点是通过。 svn更新,所以IIS需要动态编译的文件(我认为就是这样),因为文件更改需要留在回购中。
答案 0 :(得分:83)
此外,如果您使用的是Visual Studio 2015的.vs目录。
答案 1 :(得分:47)
我对这种全局忽略模式运气不错:
*bin *obj *suo *.user *.tmp *.TMP *resharper* *Resharper* *ReSharper* *.Load *.gpState Thumbs.db *.~m2
我正在运行Resharper插件,所以你可能会忽略它。 “.~m2”用于我的数据建模者创建的临时文件。
更新: 谢谢你的投票。我最近添加了Mac,Dreamweaver,Python以及一些应该被忽略的Visual Studio文件。
*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp
*[Bb]in *obj *suo *resharp* *.user *.tmp *.TMP *Resharper*
*ReSharper* *.Load *.gpState *.NoLoad *.~m2 *.dbmdl _notes *.cache
[Tt]est[Rr]esult [Bb]uild[Ll]og.* *.[Pp]ublish.xml *.[Cc]ache [Tt]humbs.db lint.db
*.docstates .apdisk [Ll]ogs .DS_Store *.bak *.vs
其他的,如果有人意外地检查了应该忽略的文件夹或文件,那么在SVN再次开始忽略它们之前,您需要手动从存储库中删除文件。这是因为已经在repo中的文件将覆盖任何忽略设置。
答案 2 :(得分:8)
答案 3 :(得分:8)
旧线程,但我想补充一点,你可以使用GitHub中的gitignore示例,找到here,这是一个很好的起点。
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
*.vcxproj.filters
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# 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
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
*_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
*.VC.db
*.VC.VC.opendb
# 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
# Visual Studio code coverage results
*.coverage
*.coveragexml
# 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
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# 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
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# 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/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# 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
UpgradeLog*.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 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/
答案 4 :(得分:6)
答案 5 :(得分:6)
我认为更好的问题是“我应该向Subversion添加哪些文件?”
AnkhSVN 2.0 Subversion集成正好向您的解决方案中的所有项目提出这个问题。 (这个问题是SCC规范的关键部分之一。)然后它只建议添加这些文件。
作为用户,您可以手动添加其他文件(或标记一些建议忽略的文件),但这种行为使得正确的事情变得非常容易。
大多数其他颠覆客户端并没有真正了解真正了解应该添加和不应该添加的内容的系统。 (例如,像TortoiseSVN及其前端的外部客户可以根据文件扩展名猜测。)
答案 6 :(得分:4)
这是我的TortoiseSVN全局忽略:
*.suo *.resharper *.sln bin obj *.user *.suo Debug Release *.pdb test.* _ReSharper*.* *.scc *.vssscc *.vspscc
从Microsoft Visual SourceSafe转换时的最后3个帮助。
答案 7 :(得分:3)
AnkhSVN可以很好地检查项目所需的文件。
答案 8 :(得分:1)
我可能会在bin目录中说些什么。
答案 9 :(得分:1)
除了上面提到的人之外,我经常不得不忽略 * .cache 因为某些原因我不知道Resharper喜欢把它的.cache文件放在同一个文件夹中我工作的代码。另外,我认为还没有人提到* .pdb。
答案 10 :(得分:1)
我也不会检查.SDF文件。它很大,如果缺少Visual Studio将重新创建它。据我所知,这是一个用于Intellisense的数据库。