We am trying to move from multirepo to monorepo. In addition to move several repositories to one repository, we have several branches on each of the repositories. At least we have updated all the branches to not be behind main branch.
The current status multirepo
- repo1
- main
- branch1
- branch1
- repo2
- main
- branch1
- branch2
- repo3
- main
- branch1
- branch2
The monorepo folder structure
- apps/repo1
- apps/repo2
- apps/repo3
Expected branches in the monorepo
- main
- repo1-branch1
- repo1-branch2
- repo2-branch1
- repo2-branch2
- repo3-branch1
- repo3-branch2
As you can see in the example above, we expect that each repository code will be move into the "apps" folder. We want to do this keeping all commits history with the exception of tags.
We have tried some alternatives, but it gets complicated with the branches because after we have moved the code (main) to a subfolder (apps/repo1), the branches will have a big diff.
Anyone as a recipe step by step to perform these tasks.