Suppose you have local checkouts of two git repositories, a
and b
. You'd like to combine them into a new git repo c
("the monorepo"). More specifically, you'd like to:
- Preserve the combined commit history.
- Keep the commits from
a
andb
ordered chronologically inc
, interleaving as necessary. - Avoid new merge commits, because you're a rebase-only freak like me. Most answers on the internet use
git merge
. - Ignore all branches of
a
andb
other thanmaster
. It's possible to port them over, but would significantly complicate these instructions. So for now that's an exercise left for the reader.