Rewrite history git filter-branch create / split into submodules / subprojects

I resolved my own question, here is the solution: git-submodule-split library another_library Script git-submodule-split: #!/bin/bash set -eu if [ $# -eq 0 ] then echo “Usage: $0 submodules-to-split” fi export _tmp=$(mktemp -d) export _libs=”$@” for i in $_libs do mkdir -p $_tmp/$i done git filter-branch –commit-filter ‘ function gitCommit() { git add -A if [ … Read more