I would like to to a pretty standard repository split-up. The original repository has to following structure:
root
|-AAA
|-BBB
|-BBB1
|-BBB2
|-CCC
I tried to extract the directory BBB1 and all its contents into an individual repository using the command
git filter-branch --subdirectory-filter BBB/BBB1 -- --all
which leads to git rewriting a bunch of commits and ends with git's final statement
Ref 'refs/heads/master' was rewritten
So this seems perfectly fine for me. But when I take a look into the root directory after git has finished, the repository no longer contains any source files but only the .git folder at root. Browsing this repository with SourceTree I can see in the log the (probably) correct commits which would have affected BBB1 only, but each commit no longer references any files as they are all gone!
What am I doing wrong? Why are all the files gone, even the ones I actually filtered for?
Thanks in advance!
Simon