【发布时间】:2021-07-31 02:15:09
【问题描述】:
假设我有一个repo,其子模块结构如下:
[submodule "themes/sanskrit-documentation-theme-hugo"]
path = themes/sanskrit-documentation-theme-hugo
url = https://github.com/sanskrit-coders/sanskrit-documentation-theme-hugo.git
update = merge
[submodule "content"]
path = content
url = https://github.com/vvasuki/kAvyam.git
branch = content
update = merge
在查看云端存储库时,我希望将所有子模块更新为来自各自远程分支的最新提交。
在 github 操作中,如果我运行(例如 here 和 workflow file)git submodule update --remote --merge,我会收到此错误 fatal: Needed a single revision。是什么赋予了?有其他选择吗?
尝试了替代方案
git submodule foreach "(git checkout $(git config -f $toplevel/.gitmodules submodule.$name.branch || echo master); git pull)&" - 这适用于我的计算机,但不适用于 github 操作(主分支是 wrongly checked out 用于子模块内容)。
【问题讨论】:
-
您不能与
--depth 1合并(无论如何;一些非常具体、相对谨慎的情况可能会起作用)。在子模块中使用更深的或完整的克隆。
标签: git git-submodules github-actions