-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge many repos into one, squashing all merge commits. #611
Comments
What's the goal with having a linear history? If you want a list of what happened in order, you can always use If you were happy with that, you could create your monorepo by just creating a merge commit that merges the relavant branches on each of the smaller current repos. If you really wanted a linear history, I suspect filter-repo is the wrong tool for the job. I'd do this by getting a list of commits in the right order with that |
Sure, two reasons: Uniformity with one of the existing repos. Most existing merge commits either contain a single commit or have many bad commits like "todo", "fix it".
Gotcha. The problem is there are probably 30k commits, so I can't do it by hand. Could I operate on the fast-export format directly? |
Ah, okay! I'd thought that you wanted to keep all the non-merge commits, but have them appear linearly in the commit history. From what you're saying here, you want to only keep the first parent of each merge commit, so all the commits made on a temporary branch will get discarded. Is that right?
With hindsight, I didn't say what I'd intended to say here. I think what you're asking for (and what I'd previously thought you were asking for) can be achieved using filter-repo; you'd need to write a commit callback to rewrite commits to have the parents you'd want. The alternative I was suggesting wasn't to do it by hand, but to generate the list of commits you want to keep, in order, using |
Yes, I think so. I don't care about the individual commits in the merged branches; I only care about the overall result of applying the merge commit. For the following history:
I want each merged branch to collapse into a single commit, so something like:
Ideally, I could use one of the commit messages from each merged branch to get the following:
I'm not totally sure I follow. Is the idea something like the following?
|
Hi there, I have a thorny problem I could use some pointers on:
I'm trying to convert a collection of 40 multi-repos into a monorepo. My main goals are:
I can guarantee that paths from different repos won't collide.
For 1: It's straightforward to stack commits in repo order [A1, A2, A3, B1, B2, C1, C2]. Is it possible to order like [A1, B1, C1, B2, C2, A3]?
For 2: I could use pointers on operating git filter repo across multiple commits. The docs I've read demonstrate modifying individual commits in isolation.
The text was updated successfully, but these errors were encountered: