问题描述
我想知道是否可以使用nuget在版本控制中仅存储对所需软件包的引用(仅限于package.config并忽略软件包文件夹)。
有没有办法告诉nuget(重新)下载各种package.config文件中的所有引用包?或者类似的东西可以放到构建脚本中。
更新:
看起来我并不是唯一请求此功能的人:(谢谢到PHeiberg的提示)
更新2:
功能内置。请参阅了解详情。剩下的就是把packages目录添加到.gitignore或者你的VCS的一些等价物中( / packages /
)如果你在版本库的根目录下有这个技巧,使用git)。
我刚刚了解到有关NuGetPowerTools:
另请参阅:
p>I wonder if it is possible to use nuget to only store references to the required packages in version control (only the package.config and ignore the packages folder).
Is there a way to tell nuget to (re)download all the referenced packages in the various package.config files? Or something similar which could be put into a build script.
Update:
Seems that I'm not the only one who requested this feature: See this work item (thanks to PHeiberg for the hint)
Update 2:
NuGet now has this feature builtin. See Using NuGet without committing packages to source control for details. All left is to add the packages directory to .gitignore or some equivalent of your VCS (/packages/
will do the trick if you have it in the root of your repository and are using git).
I just found out about NuGetPowerTools: https://github.com/davidfowl/NuGetPowerTools
Also see: http://blog.davidebbo.com/2011/08/easy-way-to-set-up-nuget-to-restore.html
Update: NuGet 1.6 now supports Package Restore: http://docs.nuget.org/docs/release-notes/nuget-1.6
这篇关于NuGet和分布式版本控制(DVCS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!