Skip to content

Instantly share code, notes, and snippets.

@Ethan-code
Ethan-code / rebase_first_commit.sh
Created October 13, 2017 06:57 — forked from framon/rebase_first_commit.sh
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