- We want to move all files under
library/hottinleanprover/libraryrepo tosrc/library/hottinleanprover/leanrepo. - We want to preserve the commit history of
leanprover/libraryduring the migration.
I assume that leanprover/lean repo is already cloned at ~/work/lean.
-
Add
leanprover/librariesrepo as a remote.cd ~/work/lean git remote add libs [email protected]:leanprover/libraries git fetch libs -
Create a local branch
libsbased onlibs/master.git co -b libs libs/master -
Extract files under
library/hottand move them tosrc/library/hott.
First, please save the following script as extract_and_move.
```bash
#!/usr/bin/env bash
if [ ! $# -eq 2 ] then echo "./extract_and_move " exit 1 fi SRC=$1 DEST=$2 DEST_FIRST=${DEST%%/*}
git filter-branch -f --prune-empty --subdirectory-filter $SRC -- HEAD
git filter-branch -f --prune-empty --tree-filter "mkdir -p
and use:
extract_and_move library/hott src/library/hott
-
Switch back to
masterbranchgit co master -
Take commits in
libsbranch on top ofmasterby rebase.git rebase --onto libs master master