在源代码管理中如何处理大型库依赖? [英] How does one handle big library dependencies in source control?
问题描述
什么是最好的方式来处理这种问题?
大多数版本控制工具/系统提供了添加对其他存储库的引用的机制您的存储库。
这样,您可以将存储库从其他存储库的文件中清理干净,但仍然可以指向正确的库和版本。
在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屋!