gpt4 book ai didi

git子模块 "--reference"参数

转载 作者:行者123 更新时间:2023-12-01 15:39:39 25 4
gpt4 key购买 nike

git submodule git submodule add 的文档,说明有--reference范围。据推测,这与 --reference 的工作方式相同。 git clone 的参数通过从中复制对象而不是远程存储库来工作。使用此参数执行后,如果我查看 .git/modules/<submodule>/objects/info ,有一个alternates文件,包含引用仓库的路径。

但是,git clone还有一个 --dissociate 参数,基本上只对初始克隆执行此操作。子模块存储库有没有办法做同样的事情?

最佳答案

git submodule update ”和“git submodule add ”支持“--reference ”选项从邻近的本地存储库中借用对象,例如“git clone ”,但缺少最近的发明“--dissociate ”。
Git 2.18(2018 年第二季度)不再是这种情况

submodule: add --dissociate option to add/update commands

Add --dissociate option to add and update commands, both clone helper commands that already have the --reference option --dissociate pairs with.


The documentation现在补充:
--dissociate::

This option is only valid for add and update commands.
These commands sometimes need to clone a remote repository. In this case, this option will be passed to the git clone command.

关于git子模块 "--reference"参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43256688/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com