简体   繁体   English

Git - 带有子模块的 Fork boost

[英]Git - Fork boost with submodule

I've run into an issue that isn't clear to me how I can solve it.我遇到了一个我不清楚如何解决的问题。 I'd like to add boost to my project, and I'd like to keep a copy in our team's account so that we can all have the same version.我想为我的项目添加 boost,并且我想在我们团队的帐户中保留一个副本,以便我们都可以拥有相同的版本。 So, I forked boost via the instructions on github ( https://help.github.com/en/github/getting-started-with-github/fork-a-repo ) by essentially clicking a button.因此,我通过 github ( https://help.github.com/en/github/getting-started-with-github/fork-a-repo ) 上的说明通过基本上单击一个按钮来分叉 boost。 I then added boost as a submodule using the appropriate git commands to the project.然后,我使用适当的 git 命令将 boost 作为子模块添加到项目中。 However, I discovered that boost itself has a number of additional submodules in the libs folder that now don't point to the correct location.但是,我发现 boost 本身在 libs 文件夹中有许多额外的子模块,这些子模块现在没有指向正确的位置。 It is looking for those submodules in our account instead of from boost.它正在我们的帐户中而不是从 boost 中寻找那些子模块。

I'd like to get a copy of all of these and freeze them at their current version just like boost.我想获得所有这些的副本,并像 boost 一样将它们冻结在当前版本中。 Do I have to go through and fork every single one of these submodules manually?我是否必须手动遍历并分叉这些子模块中的每一个? Or, how should I have set this up correctly to fork boost and bring along a fork of all its submodules?或者,我应该如何正确设置它以分叉提升并带来所有子模块的分叉? Thanks for any help.谢谢你的帮助。

Hello @ConfusedStatGuy,你好@ConfusedStatGuy,

You can use git <command> --recurse-submodules to perform your operations for submodules inside submodules.您可以使用git <command> --recurse-submodules模块内的子模块执行操作。 This will help you save time by Git dealing with all the submodules on its own rather than you trying to configure/make changes to every submodule.这将帮助您通过 Git 自行处理所有子模块而不是您尝试配置/更改每个子模块来节省时间。

Also, I think freezing the submodules to a fixed version won't be a really good idea for obvious reasons unless your project does not aim to upgrade to any newer dependencies any soon.另外,我认为出于显而易见的原因,将子模块冻结为固定版本并不是一个好主意,除非您的项目不打算很快升级到任何更新的依赖项。

Please refer to this and this for more information.请参阅以获取更多信息。

Best.最好的事物。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM