I know how to manually split a commit using git rebase -i
, but how can I automatically split every commit in a branch by file?
For instance, commit
For every commit, you would need
first to list all files in that commit
git diff-tree --no-commit-id --name-only -r
then for each file, extract that file
git show :/path/within/repo/to/file
Do that in a working tree of a dedicated branch, and for every file extracted, add and commit.
Then you can reset your current branch by that new one built commit-file by commit-file.