# split the "main repo" into branches and preserve full history
git subtree split -P client -b <client>
git subtree split -P server -b <server>
# For each branch that you extract client/server
# create a git repo (which will be used for submodules)
# Add the content to the git server
# add remote for client
git remote add submodule1 <client_url>
# push the submodule
git push submodule1 <branch>
1条答案
按热度按时间gzjq41n41#
subtree split
TL;DR;
subtree split
会将你的内容“拆分”到分支中长回答
怎么做的?
git subtree split <path> -b <branch>
,然后为每个子模块添加remote,并将分支推送到remote。字符串
型
添加完所有子模块后,提交
.gitmodules
文件