-
Clone
git clone <remote-url> <dir> cd <dir> git remote rm origin
-
Find a start commit of your history
START=git log | grep ...
-
Create new orphan branch
git checkout --orphan new-root echo "This is a new repo" > README.md git commit -m "Initial commit" README.md
-
Rebase
git rebase --onto new-root ${START}~ master
-
Cleanup & push
git branch -D new-root git remote add origin <new-remote-url> git push origin master
Last active
August 29, 2015 14:04
-
-
Save korya/fcbea22b4f96ce9b14a2 to your computer and use it in GitHub Desktop.
Convert git repo subhistory to a separate git repo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment