37

我目前使用Visual Studio 2010的类似问题的答案作为我的 go to hgignore 文件。VS2012 中是否包含任何值得注意的附加功能?


以下是来自许多不同来源的编译列表。要点在这里

我发现从VS2010升级的项目有很多不需要的备份和升级日志文件。

# use glob syntax
syntax: glob

*.obj
*.pdb
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.scc
[Bb]in
[Dd]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
[Tt]humbs.db
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml
*.resharper

# For projects upgraded from VS2010
[Bb]ackup/
_UpgradeReport_Files/
UpgradeLog.*

*.opensdf
*.sdf
ipch/
x64/
4

2 回答 2

60

通过从这个关于 Visual Studio 2010 的先前答案中提取,从这个问题中的这个响应中提取,以及这个精彩的引文中,我编译了这个清单:

############################################################
## Visual Studio 2012
############################################################
syntax: glob

## User-specific files

*.suo
*.user
*.sln.docstates

## Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

## MSTest test Results

[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.scc

## Visual C++ cache files

ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

## Visual Studio profiler

*.psess
*.vsp
*.vspx

## Guidance Automation Toolkit

*.gpState

## ReSharper Ignores

_ReSharper*/
*.[Rr]e[Ss]harper

## TeamCity Ignores
_TeamCity*

## DotCover Ignores

*.dotCover

## NCrunch Ignores

*.ncrunch*
.*crunch*.local.xml

## Installshield output folder
[Ee]xpress/

## DocProject Ignores

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 Ignores

publish/

## Publish Web Output

*.Publish.xml
*.pubxml

## Windows Azure Build Ignores

csx
*.build.csdef

## Windows Store Ignores

AppPackages/

## RIA/Silverlight projects

Generated_Code/

## SQL Server Ignores

App_Data/*.mdf
App_Data/*.ldf

## Backup & Report Files when converting a solution
## Not required, we have mercurial!

_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

## NuGet
packages/

## Miscellaneous Ignores

sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

## Windows Ignores

$RECYCLE.BIN/
Thumbs.db
ehthumbs.db
Desktop.ini

这目前在我的存储库中运行良好。

于 2012-10-19T19:31:38.547 回答
2

我通常边走边构建它们,但这是我目前用于相当复杂项目的一个很好的起点。该ipch/目录是VS2012中唯一的新东西。

ipch/
x64/
*Debug/
*Release/
TestResults/
*sdf
*.suo
*.user

*Debug/*Release处理以 . 为目标的设备驱动程序,Win7 Release例如。如果需要,可以单独列出和*.opensdf文件。*.sdf

于 2012-10-04T03:01:22.723 回答