I'm trying to understand the difference between git subtree split & git filter-branch for a particular use case. This question is similar to Difference between git filter branch and git subtree?, but not exactly the same.
Given a repo with /sub/folder, execute these commands:
git checkout master
git checkout -b subtree-branch-1
git filter-branch --subdirectory-filter sub/folder
You end up with a branch that has just the commits that apply to /sub/folder. Now let's start again:
git checkout master
git subtree split -P sub/folder -b subtree-branch-2
git checkout subtree-branch-2
To me, it looks like I end up with the exact same. TortoiseGit's Revision Graph looks the same:
...the logs for these two branches look the same, & the working directory looks the same. I've found a number of questions/posts that try to explain the difference between filter-branch & subtree split, but based on the above, I'm just not seeing it. And if they do really yield identical results, what was the point of introducing subtree split -P? Is it basically just an alias for filter-branch --subdirectory-filter?