-
Clone project
-
Checkout all branches that contain the files that should be moved
-
Delete the remote
-
Run the filter-branch command:
git filter-branch --tree-filter 'mkdir -p /path/to/tmp; mv * /path/to/tmp; mkdir subdir; mv /path/to/tmp/* subdir/' --tag-name-filter cat --prune-empty -- --all
- All files are first copied to a temporary dir and move from there to the new destination
- Existing tags are updated