【问题标题】:visual studio 2013 GIT ignore list doesn't ignore dllsVisual Studio 2013 GIT 忽略列表不会忽略 dll
【发布时间】:2015-05-03 05:21:40
【问题描述】:

我在 Visual Studio 2013 上使用 Visual Studio Online GIT 存储库,出于某种原因,我的项目 bin、obj 目录和其他 Dll 和 Pdb 在更改跟踪中不会被忽略。

这是我的 .gitignore 文件,我尝试了所有在网上找到的建议,比如添加 .tfignore 和其他东西,没有任何帮助。

# Download this file using PowerShell v3 under Windows with the following comand
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

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

# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.dll
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# OS generated files #
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# 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
*.Publish.xml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

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

# EPiServer Site file (VPP)
AppData/

# 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

# vim
*.txt~
*.swp
*.swo

# svn
.svn

# SQL Server files
**/App_Data/*.mdf
**/App_Data/*.ldf
**/App_Data/*.sdf


#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml

# =========================
# Windows detritus
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac desktop service store files
.DS_Store

# SASS Compiler cache
.sass-cache

# Visual Studio 2014 CTP
**/*.sln.ide
*.dll
*.pdb

忽略列表中的最后一部分,有助于忽略未跟踪更改中的 dll 和 pdb,但不包括包含的更改和排除的更改

 # Visual Studio 2014 CTP
    **/*.sln.ide
    *.dll
    *.pdb

【问题讨论】:

  • 您已经签入了吗? .gitignore 仅适用于不在存储库中的新文件。
  • @EdwardThomson 是的。我碰巧检查过一次。我将如何删除它?

标签: git visual-studio-2013 gitignore


【解决方案1】:

将 **/ 添加到 dll 目录,因为这会在任何文件夹(不仅仅是根目录)中搜索它们:

**/*.dll
**/*.pdb

使用“git rm 文件”(或“git rm -rf 文件夹”删除整个 bin 文件夹)删除您当前的文件。

【讨论】:

  • 我试图在 GIT Bash "git rm -rf OneProjectFolderName/bin" 中运行它,它给出了一个致命错误:pathspec 'OneProjectFolderName/bin' 与任何文件都不匹配
  • 已经更新了 gist gist.github.com/kmorcinek/2710267 以忽略 nuget 包。
猜你喜欢
  • 2014-06-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-02-21
  • 2018-07-25
  • 1970-01-01
相关资源
最近更新 更多