-
-
Save bmunoz89/db9c6c371686301ba005e0e407835f74 to your computer and use it in GitHub Desktop.
Insert commit as first, allowing rebase of initial commit
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
# first you need a new empty branch; let's call it `newroot` | |
git checkout --orphan newroot | |
git rm --cached -r . | |
# then you apply the same steps | |
git commit --allow-empty -m 'initial commit' | |
# or add some files for the first commit | |
git add . | |
git commit -m 'initial commit' | |
git rebase --onto newroot --root master | |
git branch -d newroot | |
# if you have another files is required to do this | |
git rebase --skip | |
# and finally | |
git push --force | |
git branch -D newroot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment