git - git clone --recurse-submodules 记录子模块的绝对路径
问题描述
git clone --recurse-submodules
正在记录子模块的绝对路径。
也就是说,当我克隆父目录时,gitdir
每个子模块的 .git 文件夹中的值都记录了子模块的绝对路径,这使得我无法移动新克隆的目录,而所有子模块都无法使用。
在原始存储库中,我首先制作子模块的 .git 文件如下所示:
gitdir: ../../.git/modules/data/scta-codices
但是在使用 git clone --recurse-submodules git@github.com:scta/scta-rdf.git 克隆到一个新目录后,.git 文件看起来像:
gitdir: /Users/username/Desktop/scta-rdf/.git/modules/data/scta-projectfiles
关于出了什么问题的任何想法?
这是 .gitmodules 文件在父目录中的样子:
[submodule "data/scta-projectfiles"]
path = data/scta-projectfiles
url = https://github.com/scta/scta-projectfiles
branch = master
[submodule "data/scta-codices"]
path = data/scta-codices
url = https://github.com/scta/scta-codices
branch = master
[submodule "data/scta-quotations"]
path = data/scta-quotations
url = https://github.com/scta/scta-quotations
branch = master
[submodule "data/lombardpress-lists"]
path = data/lombardpress-lists
url = https://github.com/lombardpress/lombardpress-lists
branch = master
[submodule "data/scta-rdf-schema"]
path = data/scta-rdf-schema
url = https://github.com/scta/scta-rdf-schema
branch = master
[submodule "data/scta-people"]
path = data/scta-people
url = https://github.com/scta/scta-people
branch = master
解决方案
This is actually fixed in Git v2.8.3, released in May 2016. Although the commit message might not look like it, and there was no release note entry either, this is the actual fix (I verified it by bisecting the git with itself).
See also the mailing list discussion which led to the fix of this bug.
The problematic Git version is still present in Ubuntu 16.04 LTS, for example.
推荐阅读
- erlang - 如何将整数存储在列表中
- python - 将 pip 作为命令行命令调用和将其作为 python 命令的模块调用有什么区别?
- javascript - 如何在 Fullcalendar v5 中显示和隐藏事件
- python - 为什么当它的格式正确时会出现属性错误?
- python - 对新列中布尔值的数量(基于不同列中的值组)求和
- android - RecyclerView里面的RecyclerView,由于高内存消耗导致app崩溃
- python - Matplotlib 将文本设置默认为希腊语,我不希望这样
- firebase - firestore 安全规则:拒绝配置文件更新但允许评级更新
- javascript - 播放后如何重置 CSS 过渡
- android - 尝试在颤振中使用自定义 EventChannel 时出现 MissingPluginException