If you are trying to squash 4985258, da0a945 then you will get this exception if you mark all commits with s
You will get error when you squash commits like any one of the below screens: All below screens are wrong and squash will fail. Always remember the first commit should have ‘r’ i,e reword
Correct Squash Order:
Solution: If you are in middle of rebase then run git rebase –edit-todo
Step1:
$ git rebase --edit-todo
Step2: You will get screen like below and change from squash to “r” for reword
press 'i' for insert replace squash with r //reword
Step3: Run git rebase –continue.
A new window will open and change the message if required
Step4: git push -f
Solution2 :
If you are not in middle of git rebase and want to squash then abort the rebase and restart like shown below:
$ git rebase --continue error: cannot 'squash' without a previous commit error: please fix this using 'git rebase --edit-todo'. jayaramp@jayaram MINGW64 /d/GITDemo/gitdemo (main|REBASE) $ git rebase --abort $ git rebase -i HEAD~3