TFS中NuGet软件包文件夹的正确tfignore是什么?

时间:2019-02-15 16:30:06

标签: visual-studio tfs nuget nuget-package ignore

我在TFS存储库中有一个共享的NuGet packages文件夹,我希望TFS忽略此文件夹中的多余文件。

目前这是我的tfignore文件的内容,但是我认为我们忽略了一些事情:

# NuGet autogenerate files

*.nupkg
*.nuget.props
*.nuget.targets
project.lock.json
project.assets.json

# Unwanted files (everything except for DLL)

*.js
*.ps1
*.p7s
*.transform
*.css
*.eot
*.svg
*.ttf
*.woff
*.map
*.xml
*.xdt
*.pp
*.props
*.rsp
*.targets
*.config
*.ini
*.txt
*.rtf

例如,根据this answer,似乎nukpg应该存在于所有计算机上

为此目的最小和正确的tfignore内容是什么?

1 个答案:

答案 0 :(得分:0)

nukpg是软件包,您确定需要忽略它们,而不要将它们检入TFS(在运行nuget restore的过程中)。

Microsoft here将此.tfignore推荐给NuGet:

 # Ignore NuGet Packages
*.nupkg

# Ignore the NuGet packages folder in the root of the repository. If needed, prefix 'packages'
# with additional folder names if it's not in the same folder as .tfignore.   
packages

# Exclude package target files which may be required for MSBuild, again prefixing the folder name as needed.
!packages/*.targets

# Omit temporary files
project.lock.json
project.assets.json
*.nuget.props