Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Insert commit as first, allowing rebase of initial commit
# first you need a new empty branch; let's call it `newroot`
git checkout --orphan newroot
git rm -rf .
# then you apply the same steps
git commit --allow-empty -m 'root commit'
git rebase --onto newroot --root master
git branch -d newroot

This comment has been minimized.

Copy link

@gh28 gh28 commented Dec 1, 2017

git rebase -i --root

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment