Let's say there is repo-source that has sub-directory z under x/y which we want to move to repo-target:
- go to source repo -
cd repo-source - extract files from
zinto a new branchz-only-git subtree split -P x/y/z -b z-only
Now if we checkout to z-only branch all files from x/y/z will be in the root directory.
In order to preserve original directory structure move directories/files into x/y/z manually:
- re-create
x/y/zdirectory -mkdir -P x/y/z(mkdir x\y\zon Windows)