I'm working with multiple git repositories and need to modify many of them to implement new features. So I got the idea to combine those repositories into one to reduce the administration effort and the need to create branches for each feature in all the repositories.
a a a a a
| b | b | b | b | b
| | c | | e | | c | | c | | c
|/ | d |/ | d |/ | d |/ | d |/ | d
| / | | / | | / | | / | | / |
| / / | / / | / / | / / | / /
|/ / |/ / |/ / |/ / |/ /
| / | / | / | / | /
| / | / | / | / | /
|/ |/ |/ |/ |/
| | | | |
A B C D E
I found multiple answers for merging a specific branch of one repository into a branch of other repositories like merging branches of two git repositories or using git subtree. That's not what I want to do.
I want to integrate the whole repository B with all branches and commits into A. In the end there are multiple roots in one repository with a bunch of branches each.
a a
| b b |
| | c e | |
|/ | d d | \|
| / | | \ |
| / / \ \ | ...
|/ / \ \|
| / \ |
| / \ |
|/ \|
| |
A (B)
Then I want to merge all branches according to their feature (a, b, d) to get all trees connected together.
a
/ \
/ \
/ b \
/ / \ \
/ / \ \
/ / \ \
/ / \ \
a / \ a
| b d b |
| | c / \ e | |
|/ | d d | \|
| / | | \ |
| / / \ \ |
|/ / \ \|
| / \ |
| / \ |
|/ \|
| |
A (B)
I think there must be something like a svn dump to dump all the information of repository B and load it to an orphan branch in the target repository A.
The history of each file should still be available at the end to be able to blame changes made in the separated repositories.
To make it clear: I do not want to merge branches of different repositories. I want to combine the whole repositories A and B with all the branches and the commit history.