[英]Copy git repo with sub-modules as directory into another repo
Recently I cloned gRPC
repo from GitHub which has various submodules like protobuf, zlib,
etc. I have a different repo X
of my own. 最近,我从GitHub克隆了
gRPC
库,该库具有各种子模块,例如protobuf, zlib,
等。我有一个自己的存储库X
Following is what I did. 以下是我所做的。
gRPC
folder into folder X
gRPC
文件夹复制到文件夹X
X
into origin master X
的更改推送到原始主机 Y
Y
protbuf, zlib,
etc. in Y
Y
protbuf, zlib,
不到protbuf, zlib,
等的内容 Seems I did something wrong in steps 2 and 3. All I wanted to do was put everything from gRPC
into X
as clean directory structure. 好像我做错了什么事在步骤2和3。所有我想要做的是把一切从
gRPC
成X
为干净的目录结构。 What are the steps to accomplish this? 有哪些步骤可以做到这一点?
I removed all .git
and .gitmodules
from all directories that I wanted to be part of X
. 我从我希望成为
X
一部分的所有目录中删除了所有.git
和.gitmodules
。 Then, for each of those folders did the following as explained in https://stackoverflow.com/a/31270959/4825809 然后,针对每个文件夹执行以下操作,如https://stackoverflow.com/a/31270959/4825809所述
git rm --cached directory
git add directory
Now I can see committed protobuf
in fresh clone
. 现在,我可以看到新鲜
clone
protobuf
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.