编译LibreOffice Core时执行make命令出现git子模块错误求助
解决LibreOffice Core编译时git submodule错误
问题场景
执行以下LibreOffice Core编译步骤:
git clone git://anongit.freedesktop.org/libreoffice/core cd ~/core/ ./autogen.sh --with-lang=en_US make
编译过程中触发git submodule命令参数错误,报错信息如下:
cd /home/liandro/core && ./g -f clone Submodule 'translations' (git://anongit.freedesktop.org/libreoffice/translations) registered for path 'translations' usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>] or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...] or: git submodule [--quiet] init [--] [<path>...] or: git submodule [--quiet] deinit [-f|--force] [--] <path>... or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...] or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...] or: git submodule [--quiet] foreach [--recursive] <command> or: git submodule [--quiet] sync [--recursive] [--] [<path>...] make: *** [get-submodules] Error 1
多次执行make均出现相同错误。
解决方案
方法一:手动初始化并更新子模块
直接手动完成子模块的拉取操作,绕过脚本的错误调用:
# 在core项目根目录执行 git submodule init git submodule update --recursive
完成后重新执行make即可继续编译。
方法二:同步子模块配置后重新初始化
如果方法一无效,先同步子模块的远程配置信息,再重新初始化:
git submodule sync --recursive git submodule update --init --recursive
执行完成后再次运行make。
方法三:重新添加translations子模块
如果子模块的本地注册信息损坏,手动清理旧记录后重新添加:
git rm --cached translations rm -rf .git/modules/translations git submodule add git://anongit.freedesktop.org/libreoffice/translations translations
添加完成后执行make恢复编译流程。
内容的提问来源于stack exchange,提问作者Liandro Cos
相关产品推荐
相关产品推荐

