0

I'm still learning git so don't have a clear idea.

I created a new repository and made 3 commits.

enter image description here

I want to rebase all the commits starting from the first one.

I do the command

git rebase -i 4a5244b

This is what's shown

enter image description here

The first commit 4a5244b is not there. Is this just a special edge case with rebase where you can edit the first commit or am I doing something wrong?

enzio902
  • 457
  • 6
  • 14
  • 1
    Possible duplicate of [Edit the root commit in Git?](https://stackoverflow.com/questions/2119480/edit-the-root-commit-in-git) – spidyx Feb 22 '19 at 12:45

1 Answers1

2

Yes, it's a special edge case because rebase asks you for a base commit and there is no ancestor of the root commit that you could give it. Fortunately, there is an option for this special case:

git rebase -i --root
Jan Krüger
  • 17,870
  • 3
  • 59
  • 51