GitInterview preparation
Foundation·Concept·2 min read

How do I resolve a merge conflict or find a bad commit?

Practice this question

Definition:

A merge conflict means Git cannot automatically decide how competing changes should combine. Resolving it requires understanding the intended behavior, not just removing conflict markers. Bisect solves a different problem: it narrows the commit range that introduced a reproducible regression through repeated good/bad checks.

Key points:

  • Read both changes and preserve the intended combined behavior.

  • Run relevant checks after resolving conflicts; do not choose a side blindly.

  • Use git bisect with known good and bad commits to narrow down a regression.

  • A useful bisect check must be repeatable; flaky tests can identify the wrong commit.

Interview point:

  • Re-run the affected behavior after conflict resolution because syntactically valid combined code can still be logically wrong.
Adapted from 09_TESTING_GIT_DOCKER_CLOUD.md · “How do I resolve a merge conflict or find a bad commit?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.