NuGet 和分布式版本控制 (DVCS)
我想知道是否可以使用 nuget 仅存储对版本控制中所需包的引用(仅 package.config 并忽略 packages 文件夹)。
有没有办法告诉 nuget (重新)下载各个 package.config 文件中所有引用的包?或者类似的东西可以放入构建脚本中。
更新:
似乎我不是唯一请求此功能的人:查看此工作项(感谢 PHeiberg 的提示)
更新 2:
NuGet 现在内置了此功能。请参阅使用 NuGet 而不将包提交到源代码管理了解详情。剩下的就是将软件包目录添加到 .gitignore 或 VCS 的某个等效文件中(如果您将它放在存储库的根目录中并且正在使用 git,则 /packages/
就可以了)。
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).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我刚刚发现 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
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
我不知道你的第一个问题。
至于让 CI 服务器自动更新软件包,理论上是可行的。您可以链接“List-Package -Installed”和“Update-Package”命令,并将每个包更新到最新版本。有关更多详细信息,请参阅命令参考。
斯科特·格思里 在主题上这样说:
:
在您发表评论后,我看到您想要实现的目标。我发现这个长线程。解决方案显然不会成为 v1 的一部分。您选择的 CI 中的自定义构建任务和配置您的存储库是我看到的唯一解决方案,请报告您的发现。
I don't know about your first question.
As for having a CI server automatically update the packages, it's doable in theory. You could chain the "List-Package -Installed" and the "Update-Package" commands and have each package updated to the latest version. See the command reference for further details.
Scott Guthrie says this on the topic:
Edit:
After your comment I see what you're trying to achieve. I found this long thread in the NuPack discussions list about the issue. A solution will apparently not be part of v1. A custom build task in the CI of your choice and a config in your repo for it is the only solution I see. Please report back with your findings. You got me interested.
当前有关于此问题的讨论 Phil Haack 的博客,他在其中寻求有关如何解决此问题的反馈问题。
There is a current discussion about this question at Phil Haack's blog, where he is asking for feedback on how to tackle this question.