As the original poor explainer commenter, I can clarify what I meant there.
Unlike many git commands (such as checkout), which update your repo/index/workdir and then return control back to you, it is possible for git to exit in the middle of a merge or rebase and give control back to the user. This is particularly important because it gives you a chance to resolve merge conflicts before continuing your merge or rebase.
git merge --abort
git rebase --continue | --skip | --abort | --edit-todo
If a merge fails, git will show you this message:
Automatic merge failed; fix conflicts and then commit the result.
And during a rebase, git will show you this message:
Failed to merge in the changes.
Patch failed at (step)
When you have resolved this problem run "git rebase --continue". If
you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase
--abort".
In either case running git status
will list some files as
# Unmerged paths:
# (use "git add/rm ..." as appropriate to mark resolution)
#
# both modified: YOURFILE
#
It's not particularly counterintuitive, unless you expect git to either succeed entirely or fail immediately before returning control to you. You can also find yourself in trouble if you leave a directory in the middle of a merge or rebase, forget about it, and return to it later expecting to operate it as normal. One helpful technique is to add your branch name and merge state onto your shell prompt, which I've found helpful to remember which state my working directory is in at any given time.