Replies: 4 comments 3 replies
-
Anyone any idea, what I could be doing wrong? |
Beta Was this translation helpful? Give feedback.
-
You might want to use Then git complains to you because you have no 'master' branch, but you do have a origin1/master remote tracking branch AND an origin2/master remote tracking branch AND an origin4/master remote tracking branch, etc., and it has no idea which one to use. However, using your current strategy you'll end up with a history like this:
Instead of one like this:
Which seems to go against what you wanted (" the history of the my new target repository is getting staggered while I would like that to be combined together when possible") If every branch has linear history, and there's an easy way to interleave the commits (e.g. by commit date), then such interleaving could be automated. But if commit dates can't be trusted (e.g. what if one commit has an earlier commit date than one of its parents on one of the lines of history?), or your initial branches contain non-linear history (i.e. you've got merge commits), then how is an interleaver supposed to work? It's a pretty hard problem in general, with no perfect solution. I've not tackled that problem in filter-repo. There are a number of other requests in the issues for something to "combine" histories with some kind of interleaving, but nothing exists currently. Sorry. |
Beta Was this translation helpful? Give feedback.
-
This is something I want as well (I'm turning a bunch of individual repositories into a monorepo). I think what I'm going to do is use git-filter-repo to join everything together in the layout I want, and once that looks good, I'll do a final step of git-fast-export reorder-in-python git-fast-import. I'm pretty familiar with the git-fast-import file format from a project I did about 4 years ago (svnrdump -> git-fast-import -> git, hours to convert large depots instead of weeks/months). I trust the timestamps in the commits of the individual repositories in question. If I do this, I'll post the code somewhere. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/mbitsnbites/git-tools/blob/master/join-git-repos.py does this. |
Beta Was this translation helpful? Give feedback.
-
I am planning to use
git-filter-repo
to merge a few multiple repositories into a brand new repository to ease the development. Only I am having some problems with it, looks like I can only merge repository at a time.For this task I have written a script which is listed below but its not working fully correctly, I am getting the following error when running the following commands:
This results in the following:
If I try to do the same in sequence by merging on repo at a time instead of trying to do them all in once then the history of the my new target repository is getting staggered while I would like that to be combined together when possible. Would this be possible somehow? I had hope to circumvent this problem by doing the merge of all in one go but no luck.
Help would be appreciated, thank you in advance 🤗 I have to admit this starting to get out of my Git comfort zone 😔
Beta Was this translation helpful? Give feedback.
All reactions