Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```shell
- git clone ... && cd ...
- git remote remove origin
- # move directory to root, remove all other from history
- git filter-branch --prune-empty --subdirectory-filter DIRECTORY master
- # move directory with history rewrite
- git filter-branch -f --index-filter \
- 'git ls-files -s | sed "s-\t\"*-&DIRECTORY/-" |
- GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
- git update-index --index-info &&
- mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' HEAD
- ```
Add Comment
Please, Sign In to add comment