在源代码管理中如何处理大型库依赖? [英] How does one handle big library dependencies in source control?

查看:114
本文介绍了在源代码管理中如何处理大型库依赖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的C ++应用程序取决于Boost。我想让一个人能够检查我的存储库,并一步一步地构建整个事情。但是,增加分配是大约100MB和数千个文件,似乎阻碍了源代码管理 - 加上我真的不需要它的版本。



什么是最好的方式来处理这种问题?

解决方案

大多数版本控制工具/系统提供了添加对其他存储库的引用的机制您的存储库。



这样,您可以将存储库从其他存储库的文件中清理干净,但仍然可以指向正确的库和版本。



在Git中,它被称为子模块。在SVN中,它被称为externals。



最后,您必须决定是否要将文件包含在您的回购中,以便其他人不必检出其他repos也是,即使引用(子模块/外部)使得这样很容易。我更喜欢干净的回购,并参考其他仓库(如果有的话)。这也将使维护和升级这些图书馆更容易。


My C++ application depends on Boost. I'd like someone to just be able to check out my repository and build the whole thing in one step. But the boost distribution is some 100MB and thousands of files, and it seems to bog down source control -- plus I really don't need it to be versioned.

What's the best way to handle this kind of problem?

解决方案

Most version control tools/systems provide mechanics to add references to other repositories into your repository.

This way you can keep your repository clean from files of other repositories but still be able to just point to the correct library and version.

In Git it’s called submodules. In SVN it’s called externals.

In the end you’ll have to decide on whether you want to include the files into your repo so others won’t have to checkout the other repos as well, even when the references (submodule/external) make just that pretty easy. I’d prefer a clean repo though and reference other repositories, if available. This will also make maintaining and upgrading those libraries a lot easier.

这篇关于在源代码管理中如何处理大型库依赖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆