What it means
Git merged everything it could and stopped at the lines both sides changed. It marks them with <<<<<<<, ======= and >>>>>>> in the files. Nothing is lost: you edit, mark resolved, and continue.
Causes and fixes
Most likely first. Run the check, and if it matches, apply the fix.
1. The same lines were changed on both branches
Check:
git status
git diff --name-only --diff-filter=U
Fix: Edit each file to the correct result, remove the markers, git add the files, then git commit (or git rebase --continue).
2. One side is clearly right for a whole file (generated files, lock files)
Check:
git diff <file>
Fix: git checkout --ours <file> or --theirs <file> (careful, they swap meaning during a rebase), then git add.
3. You want to start over
Check:
git status
Fix: git merge --abort (or git rebase --abort) returns to before the merge.
Fix it yourself
A live machine in your browser with this problem already on it. The grader checks the result.
Open the labNo account needed for your first tries.
Related errors
- error: failed to push some refs to ... (fetch first / non-fast-forward)
The remote branch has commits you don't have, so pushing would throw them away.