和分布式版本控制

和分布式版本控制

本文介绍了NuGet 和分布式版本控制 (DVCS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用 nuget 仅在版本控制中存储对所需包的引用(仅 package.config 并忽略包文件夹).

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).

有没有办法告诉 nuget(重新)下载各种 package.config 文件中所有引用的包?或者类似的东西可以放入构建脚本中.

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.

更新:

似乎我不是唯一请求此功能的人:查看此工作项(感谢 PHeiberg 的提示)

Seems that I'm not the only one who requested this feature: See this work item (thanks to PHeiberg for the hint)

更新 2:

NuGet 现在已内置此功能.请参阅使用 NuGet 而不将包提交到源代码管理详情.剩下的就是将包目录添加到 .gitignore 或您的 VCS 的一些等价物(如果您将它放在存储库的根目录中并使用 git,/packages/ 就可以解决问题)./packages/p>

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).

推荐答案

我刚刚发现了 NuGetPowerTools:https://github.com/davidfowl/NuGetPowerTools

I just found out about NuGetPowerTools: https://github.com/davidfowl/NuGetPowerTools

另见:http://blog.davidebbo.com/2011/08/easy-way-to-set-up-nuget-to-restore.html

更新:NuGet 1.6 现在支持包还原:http://docs.nuget.org/docs/release-notes/nuget-1.6

Update: NuGet 1.6 now supports Package Restore: http://docs.nuget.org/docs/release-notes/nuget-1.6

这篇关于NuGet 和分布式版本控制 (DVCS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 11:00