Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating git repo after using git-filter-repo --subdirectory-filter

I have extracted a tools folder to it's own repo using: git-filter-repo --subdirectory-filter path/to/tools

In parallel, new commits are being made in the original repo.

I would like to be able to periodically merge the changes into my filtered repo. The only thing I can think is to clone the original repo again (with the changes), apply the subdirectory-filter on it again, add it as a remote to my repo, then cherry-pick/merge the branch from there. It is a lot to perform every time there is a small change. I think there's probably a smart way to create a filtered patch from the main repo and then apply it to the filtered, but my git-skills are not sufficient.

Can someone come up with a better way to do it?

like image 603
amirblum Avatar asked Nov 14 '25 11:11

amirblum


1 Answers

Since git filter-repo will recreate the exact same commits if you run it twice on the exact same history (you confirmed it by testing), you can simply use git merge to integrate the new commits, which will appear as descendants of the previous extracted commit.

like image 197
LeGEC Avatar answered Nov 17 '25 10:11

LeGEC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!