Yesterday I saw a repository which had been rebased, resulting in a duplicated first commit, i.e. the original first commit was split into two commits, but the commit message was the same for both.
To squash these two commits, I tried to run git rebase -i --root
several times, but the first commit was not listed in the rebase list (inside the editor). The problem could be solved easily by using git reflog
, but nevertheless I have no explanation for the mentioned state of the repository.
What actions can lead to situations in which the first commit is not included in the rebase list after running git rebase -i --root
? What is the best way to get out of such situations?