Using git filter-branch to remove everything except one subdirectory

I have been trying to use git to remove everything except the source code in a particular branch. The

git filter-branch -f \
    --subdirectory-filter source_code \
    --prune-empty \
    --tag-name-filter cat -- --all

command gets me basically what I want, except it places the files in source_code/ at the root, whereas I want them all to remain in the directory. I.e.

- source_code

not just


How can I do this?

Git Baby is a git and github fan, let's start git clone.