Lessons · Git · the stop-resolve-continue loop
Stop, resolve, continue
A rebase replays your commits one at a time, so it can stop once per commit. Staging the resolved file is what tells git you are done with this one.
Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.
What it is for
People expect one conflict per rebase and get several, conclude something is wrong, and abort work that was going fine.
How to think about it
Resolve, git add, git rebase --continue. Repeat until it says it has finished. Editing the file is not enough: git cannot see an edit, only the index.
Worked example
git rebase mainIt stops on the first commit it cannot apply.
echo resolved > f.txtYou decide what the file should say.
git status --shortStill UU. Editing the file changed nothing git can see, so --continue here is refused.
git add f.txtTHIS is the signal.
git status --shortM now, not UU: the path is no longer unmerged.
git rebase --continueAnd it finishes.
git log --onelineThree commits, in a straight line.
Your turn
Tell git the conflict in f.txt is resolved.
git f.txt
Try it in a real repository
The trap
Expecting one stop. A ten-commit branch can stop ten times, and often on the same lines, because your later commits touch what your earlier ones changed.