Here is a recepie for how to split a repo.
If you have a repo that you want to split in twine, life can be simple! At least if you have been a good boy and kept the different parts in different subdirectories to begin with…
This is all you have to do:
-
Make a copy of the original repo.
-
Run
git rebase -i --root
and copy all the lines into history.log -
Then run
git log --pretty='%h' ./some_path > drop.log for commit in $(cat ./drop.log); do sed -i "s/pick \(${commit}\)/drop \1/" ./history.log; done
-
Then simply run
git rebase -i --root
again and replace all the lines with the contents of history.log -
Lastly, set the origin remote to the new repo URL:
git remote set-url origin https://git.example.com/foo/bar.git git fetch git push