Skip to content

Instantly share code, notes, and snippets.

@framon
Last active April 3, 2019 23:57
Show Gist options
  • Save framon/6319400 to your computer and use it in GitHub Desktop.
Save framon/6319400 to your computer and use it in GitHub Desktop.
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
@bef178
Copy link

bef178 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