Get 3 commits - one correct, and then two stupid cleanups, typos, etc. Therefore, I want to cross them. Fire:
git rebase -i HEAD~3
It sounds simple, and it should work - I tried it after I ran into a problem in a new repo, and it works as expected. The editor shows 3 commits, selects the top, goes through the other two, saves and exits. If I run into verbose mode, I see more detailed information - git goes into HEAD offline state, checking the 1st latch I selected, then doing "Rebasing 2/3" and "Rebasing 3/3", apparently creating some temp moves along the path - and then a message of success; the editor appears at some point, prompting me to change the commit message. Things are good.
But the same team is dying in a working repo! 3 commits in the pick-squash-squash editor .. but this time I don't see "Rebasing 2/3", instead of the very first line after HEAD is now on my SHA-1, it is deadly!
HEAD is now at 48a6c3d... <commit message> fatal: ref HEAD is not a symbolic ref
But why does git expect HEAD to be a symbolic ref? The reboot process really disables HEAD - just as I see in my example example - so why is it fatal in this second example, but not the first? cat.git / HEAD give me the SHA1 commit I selected ...
I spent several hours reading and researching, but something is simply not here, and I cannot find what it is! I suspect that perhaps some hooks are responsible (they know little about them and know that some have a problematic repo). Thank you for responding to this!
source share