Guest User

Untitled

a guest
Jul 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. ```shell
  2. git clone ... && cd ...
  3. git remote remove origin
  4. # move directory to root, remove all other from history
  5. git filter-branch --prune-empty --subdirectory-filter DIRECTORY master
  6. # move directory with history rewrite
  7. git filter-branch -f --index-filter \
  8. 'git ls-files -s | sed "s-\t\"*-&DIRECTORY/-" |
  9. GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
  10. git update-index --index-info &&
  11. mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' HEAD
  12. ```
Add Comment
Please, Sign In to add comment