A clean Git merge can break main because Git combines text, while the program depends on relationships across files. Two pull requests can change different lines and still disagree about a function name, an argument or the meaning of a value. That is a semantic merge conflict, and it is easy to miss when parallel coding agents test only their own branches.
Two green branches, one red result
Imagine a small JavaScript repository with a helper in money.mjs and an existing caller in receipt.mjs. One pull request renames the helper to make its purpose clearer. It updates the existing caller and passes the project’s checks. At the same time, another pull request adds invoice.mjs, importing the old helper name. That branch also works against the original main branch.
The two agents have each done reasonable work. The rename knows about the old receipt, but cannot update an invoice that does not exist on its branch. The invoice was written against a helper that still existed when the agent started. The mistake appears only when those changes meet.
Reproduce the conflict without overlapping edits
On the shared base, create these two files. The import path uses a relative module and .mjs extensions, so the example runs with Node.js without a package configuration.
// money.mjs
export const formatAmount = value => `$${value.toFixed(2)}`;
// receipt.mjs
import { formatAmount } from "./money.mjs";
console.log(formatAmount(12));On branch A, rename formatAmount to formatMoney in both money.mjs and receipt.mjs. Running node receipt.mjs still prints $12.00. On branch B, starting from the shared base, add invoice.mjs as follows. Running node invoice.mjs there also succeeds.
// invoice.mjs — added on branch B
import { formatAmount } from "./money.mjs";
console.log(`Invoice: ${formatAmount(20)}`);Commit the changes on their respective branches, then merge both into a test branch created from the shared base. Git can combine them without a text conflict: branch A edits existing files while branch B adds a different one. Now run node invoice.mjs. The module import fails because money.mjs no longer exports formatAmount.
The error is not a reason to discard the rename or the invoice. The combined intent is straightforward: keep the clearer name and keep the new invoice feature. Update the new caller to import and call formatMoney, then run both examples again. The resolution adapts the later change to the contract introduced by the earlier one.
A signature change has the same shape
Names are the simplest example. Another pull request might add a required currency argument to a charge function while a parallel branch adds a call that passes only the total. The files can still merge without markers. In a statically checked project, the combined build may catch the mismatch; in other code, the missing value can travel much further before anyone notices.
Deletion works similarly: a branch removes a helper after updating all callers it knows about, while another branch introduces a new dependency on that helper. What matters is the relationship between the removed definition and the new reference. Looking only for overlapping lines or matching file paths can miss it.
Behavior can change even when the build passes
Not every semantic conflict breaks an import or a signature. One pull request can change the retry limit while another adds a loop that reads it. Or two independent edits can alter different inputs to the same total. The combined program may compile and pass its existing tests while behaving differently from either author’s expectation.
Those findings need context. A new retry limit might be intentional. Two changes to a total may implement the same product decision, or they may accidentally charge twice. Merget distinguishes precise evidence from findings that need judgment. A relationship worth reviewing should not be presented as proof that the authors made a mistake.
Why another rebase is not the whole answer
Rebasing the invoice branch after the rename can expose the new state, but it does not explain the broken contract by itself. Someone still needs to run the right check, find the new caller and adapt it. With many agents opening pull requests, that repeated integration work can consume the same attention and tokens the agents were meant to save.
Merget places that work in the semantic merge queue. Its PR graph connects the renamed definition to the new caller, then resolution uses queue order to target the code the later pull request will actually join. Independent groups can move in parallel; changes that rely on each other are considered together.
Check the combination at the point of landing
For the example above, the useful checks exercise both receipt.mjs and invoice.mjs on the combined result. Testing only the branch that introduced the rename would miss the new caller. Testing only the invoice against the original base would miss the rename. A merge workflow should test the program it intends to put on main.
Timing matters too. Other work can land while a prepared result waits for review or CI. Merget rechecks the actual target before landing, and invalidated work needs another pass. Merget lands through your required checks and reviews; a resolved conflict is one input to that decision.
Start in Advisory mode on a repository with this kind of parallel work. Inspect a known rename, signature change or deleted dependency, and compare the finding with the actual combined code. A clean text merge is useful evidence. Understanding and validating the resulting program is what makes the work ready to ship.
See how Merget resolves conflicts in queue order, or sign up free and connect one repository.