On Jun 10, 2008, at 7:08 PM, Linus Torvalds wrote:
So you've seen this problem before?
Before I thought of that, I just used the trusted git reflog to find
the last commit I made before the rebase commits and did a git reset --
hard to that commit. It returned the tree to normal. Fortunately I
have rerere enabled (by creating the .git/rr-cache directory, because
I read your and Junio's posts on kernel trap). so I don't have to do
much work to reedit the conflicts.
I'm still not sure how to fixed it up and keep the merge results
though. Just work on the tree (middle-of-rebase, which is actually the
end of rebase, when it blowed up) until it's good and reset --hard my
branch to it?
git rebase --abort, I think, would actually blow away my last commit
(I sneaked in) though. git reset --hard to that last commit is
probably the right thing to do. The least confusing option would be to
update the error message to be a bit more informative, like "Did you
change the branch while rebasing? git reset --hard to your last known
commit and redo the rebase". Yet another safeguard would be for git
commit to check if there is a rebase in progress and warn or abort the
commit.
Anyway, thanks for the informative reply. I have more confidence in
git due to this accident :)
__Luke
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html