Search code examples
gitmicroservicesmonorepo

Git: fastest way to move several files from different directories to new repository


I'm working on splitting one big monolith application into several microservices in monorepo. Monolith is in a big Git repository with commit history as far as 2010.

For each new microservice, I need to extract several files from different directories while keeping their history. I've tried git subtree split but it doubles commits when files from different directories were in that commit. I've tried ajdruff/git-splits but it took 30 minutes to run 500 steps and there are around 15000 steps to go so it will run for 16 hours at least.

Is there any option to do that faster with a repository of said size?

EDIT: I know that the files I need are pretty new (added in 2018). Maybe there is possibility to do git-splits for history from 2018 or something? I can trace it back to specified commit where first those files were added.


Solution

  • The solution is the newren/git-filter-repo.