Say, I have repo A which contains folder "foo". There is also an already inited yet empty repo named B.
Here's what I've done:
git subtree split --prefix foo split-master
cd B && git pull ../A split-master
… a bunch of commits …
git remote add bigA ../A
git push bigA split-master
OK, so now I have a splitted branch split-master in A with all that commits from B. The question is - what is the reverse of split in this context? How can I reintegrate this split-master into a "big" repo?
Or is this something I actually shouldn't do? I mean, may I missing something? May be, I should pull everything from repo B?
Git subtree
command also has a merge
subcommand. It follows the syntax:
> git subtree merge -P <prefix> <commit>
So in your case, running from within repo A you could do
> git subtree merge -P foo split-master
That would reintegrate the changes made in repo B into the subtree in repo A.
There are some additional options, check the docs.