Applying git-filter-repo to subtree

240 views Asked by At

I have an existing git repository (e.g. in my organisation's private repository) consisting of several sub-projects organised in specific folders. I used git subtree to split the sub-projects and push them to a public repository:

git subtree --prefix="subprojectA/" split --rejoin
git subtree --prefix="subprojectA/" push ~/new_repos_subprojectA subA

I can now use git subtree pull and push to keep the repositories in sync:

git subtree --prefix="subprojectA/" pull new_repos_subprojectA subA

But, I need to eliminate specific files with confident data from the public repository and use git-filter-repo to a clone of the new repository:

git filter-repo --invert-paths --path confident.properties

When I now want to pull changes in the new subproject, git complains with

fatal: refusing to merge unrelated histories

Is there any way to merge the projects after applying git filter-repo?

0

There are 0 answers