Created
March 10, 2012 10:08
-
-
Save clm-a/2011024 to your computer and use it in GitHub Desktop.
Insert a blank root commit on an existing repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from http://stackoverflow.com/a/647451 | |
git symbolic-ref HEAD refs/heads/newroot | |
git rm --cached -r . | |
git clean -f -d | |
# then you apply the same steps | |
git commit --allow-empty -m 'root commit' | |
git cherry-pick $(git rev-list --reverse master | head -1) | |
git rebase --onto newroot newroot master | |
git branch -d newroot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment