Merge Conflict Resolution Checklist
A calm, repeatable process for resolving Git merge and rebase conflicts in Python repos - especially pyproject.toml, uv.lock, and Alembic migrations.
Search across all documentation pages
A calm, repeatable process for resolving Git merge and rebase conflicts in Python repos - especially pyproject.toml, uv.lock, and Alembic migrations.
merge, rebase, or cherry-pick - git status shows current state.git diff --name-only --diff-filter=U - expect pyproject.toml, uv.lock, alembic/versions/*.py.git merge --abort or git rebase --abort when you started on incorrect base.git stash push -m "pre-conflict" if uncommitted edits mix with conflict resolution.git fetch origin so you resolve against current main, not stale local copy.<<<<<<<, =======, >>>>>>> mark yours vs incoming.git log --oneline --left-right HEAD...MERGE_HEAD (merge) or incoming commits on rebase.uv.lock / poetry.lock - pick winning pyproject.toml side, delete conflict markers, run uv lock.alembic merge heads after resolution.main unless ticket requires bump.uv run ruff format on resolved .py files.git add <file> only when markers fully removed - git diff --check catches leftovers.git rebase --continue or complete merge commit after all files staged.uv sync --frozen must succeed after lock resolution.uv run ruff check .uv run mypy src/ or pyright on affected packages.uv run pytest -q - minimum affected module tests if full suite is slow.uv run alembic upgrade head on local DB when migration files conflicted.git diff origin/main...HEAD - ensure no accidental deletions of others' work.git push --force-with-lease only on your feature branch.pyproject.toml.If conflicts touch more than ~10 files unexpectedly, abort and try merge commit instead - or merge main once then resume smaller rebases.
Use IDE 3-way merge for Python sources; never auto-resolve lockfiles or migrations.
Those should be gitignored - git rm --cached and fix .gitignore, do not commit artifacts.
Prefer nbstripout pre-commit to prevent; see Git for Data/Notebooks.
Stack versions: This page was written for Python 3.14.0 (stable 3.14, maintenance 3.13), FastAPI 0.115+, Django 5.2, Flask 3.1, Pydantic 2, PyTorch 2.6+, pandas 2.2+, Polars 1.x, ruff 0.9+, and uv 0.6+.
Reviewed by Chris St. John·Last updated Jul 16, 2026