如何在git的包目录中包含子文件夹?

时间:2015-09-09 02:08:58

标签: c# .net git cvs gitignore

我试过在SO上搜索这个答案,但没有一个解决方案对我有用。我想在我的解决方案中包含xUnit.runner包以用于构建目的,但我似乎无法弄清楚如何配置.gitignore文件。到目前为止我试过这个:

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# Include the xUnit Test Runner for VSO test runs
!**/packages/xunit.runner.visualstudio.2.0.1/**
# 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

我甚至尝试了不同的迭代而没有运气:

!**/packages/xunit.runner.visualstudio.2.0.1/*
!**/packages/xunit.runner.visualstudio.2.0.1/
!**/packages/xunit.runner.visualstudio.2.0.1

这些都不起作用吗?我是否错误地订购了这些陈述?

1 个答案:

答案 0 :(得分:0)

假设您的packages文件夹位于Git根文件夹中 将其添加到您的Git忽略文件

  

!包/ xunit.runner.visualstudio.2.0.1