git 子模块可以引用 HEAD 而不是特定的提交(对于超集项目有用)吗?
我们有一堆 git 存储库:
- drools
- jbpm
- guvnor
- planner
- ...(更多),
它们是 super git 存储库中的 git 子模块,它是所有这些存储库的聚合,所以整个事情可以立即克隆并立即在我们的 IDE 中进行配置。然而,临时开发人员也只能克隆他们感兴趣的模块。
问题是,当有人将更改推送到子存储库时,超级存储库仍然停留在该子存储库的先前提交上。因此,非临时开发人员必须将该超级存储库更新为该子存储库的最新提交。
有没有办法让超级仓库自动指向子仓库的最新提交?
我们知道,对于超级 git 仓库中的每个分支或标签(例如< code>master, 5.1.x
, 5.0.x
, ...),每个子模块中都存在同名的分支或标签。
We have a bunch of git repositories:
- drools
- jbpm
- guvnor
- planner
- ... (many more)
which are a git submodules in a super git repository, which is an aggregation of all these repositories, so the whole thing can be cloned at once and configured in our IDE at once. However casual developers can also only clone the module their are interested in.
The problem is, that when someone pushes a change to a subrepository, the super repository still is stuck on the previous commit of that subrepository. So someone of the non-casual developers has to update that super repository to the latest commit of that subrepository.
Is there any way to make the super repository automatically point to the latest commit of a subrepository?
We know that for every branch or tag in the super git repository (such as master
, 5.1.x
, 5.0.x
, ...), there exists a branch or tag with the same name in each of the submodules.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这是不可能的。子模块由 SHA1(而不是名称)引用,因此它将始终“粘在”该位置。
我建议你考虑用几个脚本替换超级仓库,这些脚本可以完成你想要的(关于克隆、拉取等......)
No, this is not possible. The submodule is referenced by SHA1, (rather than a name), so it will always "stick" at that position.
I suggest you consider replacing the super-repo with a couple of scripts which accomplish what you want (regarding clone, pull, etc...)