I saw this question, but the answer does not discuss preserving the history of files that have been moved prior to the splitting of the first repository.
What I'm interested is the following scenario: there is initially one repo, and some files have been moved around in this repo at various times due to refactoring. Now, we are splitting this initial repo by choosing a subset of the files from this repo to create another. If we perform filter-branch
with the --subdirectory-filter
argument, we can restrict the new repo to only the history relevant to the remaining files.
However, after some experimentation, this seems to destroy history in the files that were created prior to the last time the file was moved (i.e., git log --follow
no longer has any record of file renames to follow).
Is there any way around this so that git blame
and git log
can still follow the full history of the file when performing the filter-branch
command, or is there any other way to preserve the history of files that have been moved or renamed?