When executed as written, the differences are pretty minor:
- your "subtree split" command will start from
HEAD
and put result to some_branch
, which must not exist before
- your "filter-branch" command will start with
some_branch
and put result back to some_branch
, overriding some_branch
with the new content.
- In my tests, "git filter-branch" was ~50x faster (on a very old repo with only a few commits touching the selected path)
In other words, the two snippets below are exactly equivalent, as long as special subtree rejoin
commits are not found.
git subtree split --prefix=some_subdir -b some_branch
git checkout some_branch
and
git checkout -b some_branch
git filter-branch --subdirectory-filter some_subdir some_branch
why bother with "git subtree" then, you may ask? For --rejoin
and --onto
options -- they support a very specific workflow which original author was using.