hraban / tomono

Multi- To Mono-repository merge
https://tomono.0brg.net
GNU Affero General Public License v3.0
842 stars 138 forks source link

How to merge repositories from different paths to monorepo and subsplit #14

Closed TomasVotruba closed 6 years ago

TomasVotruba commented 6 years ago

Plan

Steps to Reproduce

1. Tomono

# repositories.txt
git@github.com:shopsys/product-feed-zbozi.git packages/zbozi
wget https://raw.githubusercontent.com/unravelin/tomono/master/tomono.sh
chmod +x tomono.sh 
cat repositories.txt | ./tomono.sh
# move all to this level (usually done manually, so not sure if this script works)
mv core/.git .
mv core/* .

2. Split To Many Repos

git subsplit init git@github.com:TomasVotruba/shopsys-monorepo-test.git
git subsplit publish --heads="master" packages/zbozi:git@github.com:TomasVotruba/tomono-after-split-product-feed-zbozi.git
rm -rf .subsplit/

Expected

Real Result

TomasVotruba commented 6 years ago

AFAIK the problems is that before it was code in . (root diretory) and it was moved to /packages/zbozi directory. That's why the history is missing.

The only idea I have now is to use custom move script, that keeps the history as suggested by @emiller https://gist.github.com/emiller/6769886

I still have to try this out, but it might take some time, so I just drop it here.

hraban commented 6 years ago

Sorry, I'm entirely unfamiliar with git subsplit so I won't be able to be of any assistance, here :/ hope you figure it out some day! Keep us updated.

TomasVotruba commented 6 years ago

I forgot about this, we managed to resolved it by https://github.com/shopsys/monorepo-tools

Also interesting site for all curious about Monorepo: https://gomonorepo.org with intro post: https://www.tomasvotruba.cz/blog/2018/03/15/monorepo-on-the-rise-in-php/