Several options:
-
You are not on a branch (
Detached head) or maybe you are trying torebaseor the wrong branch.
Checkout the branch you want torebaseand try again. -
you don’t have 8 commits in your history (you have 7 or less)
-
try:
git rebase -i --root
Here is the documentation for the --root flag and why it will work for you.
--root
Rebase all commits reachable from <branch>, instead of limiting them with
an <upstream>.This allows you to rebase the root commit(s) on a branch.
When used with --onto, it will skip changes already contained in `<newbase>`
(instead of `<upstream>`) whereas without --onto it will operate on every
change. When used together with both --onto and --preserve-merges, all root
commits will be rewritten to have `<newbase>` as parent instead.`