git_test_project
├── tool_1
│ ├── config.txt
│ └── main.py
└── tool_2
├── config.txt
└── main.go
λ git branch tool_1
λ git filter-branch --prune-empty --subdirectory-filter tool_1 tool_1
Rewrite 34133531ba9fabc8f82161f5c8708fecf8d04dc1 (2/3) (1 seconds passed, remaining 0 predicted)
Ref 'refs/heads/tool_1' was rewritten
λ git remote set-url tool_1 D:/self/project/tool_1
λ git remote -v
tool_1 D:/self/project/tool_1 (fetch)
tool_1 D:/self/project/tool_1 (push)
λ git push tool_1 tool_1
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 12 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (9/9), 725 bytes | 725.00 KiB/s, done.
Total 9 (delta 0), reused 0 (delta 0)
To D:/self/project/tool_1
* [new branch] tool_1 -> tool_1
λ git subtree split -P tool_2 -b "tool_2"
Created branch 'tool_2'
4876dda5ff1a8f60574d3d9161784997f8345dcb