I have a large repo with a subfolder A that I would like to extract into it's own repo. I'd like to keep commit history for both the master branch and all (or at least several) release branches. I tried using git filter-branch --prune-empty --subdirectory-filter A
, but this seems to only affect the master branch (I can checkout other branches, but they still have the full original set of files). What's the best way to do this?
EDIT: I tried running git filter-branch --prune-empty --subdirectory-filter A/ -- --all
. This runs for awhile and then hangs indefinitely.
I then tried running git filter-branch --prune-empty --subdirectory-filter A/ -- --branches=*
. This runs successfully. However, when I use git checkout to checkout a different branch, that branch does not seem to have been filtered.