更新时间:2022-06-15 04:06:14
是的,子模块本身就是git repo.
您需要
Yes, a submodule is a git repo in itself.
You need to
A
和S
之间建立符号链接(仅用于代码编译,即,不必在本地干扰S
的子模块状态)A
,一个用于S
)A
and S
locally (just for your code to compile, ie don't bother with the submodule status of S
locally)A
, one for S
)只有A
和S
的维护者可以:
S
中应用拉取请求并提交A
A
中提交,记录S
(子模块)的新SHA1和A
中的更改.S
and commitA
A
, recording the new SHA1 of S
(submodule) and the changes in A
.Mark Longair 提到您可以:
A
git submodule init
git submodule update
(它将克隆S
到右侧的SHA1,但是将'S
'作为远程对象,而不是'forked-S
')cd S
git remote set-url origin <SSH-url-of-fork-of-S>
git checkout -b my-changes-to-S
:创建一个分支以记录您的本地修改,并避免进入
A
git submodule init
git submodule update
(that will clone S
to the right SHA1, but with 'S
' as a remote, not 'forked-S
')cd S
git remote set-url origin <SSH-url-of-fork-of-S>
git checkout -b my-changes-to-S
: make a branch in order to record your local modification, and to avoid being in a detached HEAD
mode.