Now document ?q= on the search branch, in the README row that the sort branch already changed on main. Set the zdiff3 conflict style first; it also shows the base version, and you want it on for good:
git config set merge.conflictStyle zdiff3
git switch -q search-api
# Edit README.md: document ?q= in the /api/books row
git commit -qam "Document the ?q= title search"
git switch -q main
git merge search-api
sed -n '/^<<<<<<</,/^>>>>>>>/p' README.mdAuto-merging README.md CONFLICT (content): Merge conflict in README.md Automatic merge failed; fix conflicts and then commit the result. <<<<<<< HEAD | GET | `/api/books` | All books; `?genre=`, `?inStock=`, `?sort=` | ||||||| 7267a50 | GET | `/api/books` | All books; `?genre=`, `?inStock=` | ======= | GET | `/api/books` | All books; `?genre=`, `?inStock=`, `?q=` | >>>>>>> search-api
The merge stopped halfway, with clean parts staged and .git/MERGE_HEAD naming the incoming tip (git status lists the file as unmerged). Your side comes first, the base after |||||||, theirs after =======. Each side added one parameter, so keep both: edit the file, delete the markers, stage and commit:
# Edit README.md: keep both parameters and delete the marker lines
git diff
git add README.md
git commit --no-editdiff --cc README.md ... - | GET | `/api/books` | All books; `?genre=`, `?inStock=`, `?sort=` | -| GET | `/api/books` | All books; `?genre=`, `?inStock=`, `?q=` | ++| GET | `/api/books` | All books; `?genre=`, `?inStock=`, `?q=`, `?sort=` | ... [main 1aaa0dc] Merge branch 'search-api'
The combined diff has one +/- column per parent; ++ marks your resolution, found in neither. git merge --abort undoes the merge, git checkout --ours <file> (or --theirs) takes one side whole, and git diff --check reports any "leftover conflict marker".