<!-- How Merget works: a semantic merge queue for GitHub · https://merget.ai/how-it-works -->

# How Merget’s semantic merge queue works.

Merget finds the pull requests that conflict, resolves them in queue order, and lands the result through your required checks and reviews.

[Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call)

## Find conflicts Git can’t see.

A renamed function and a new call to its old name can merge cleanly and still break main. That is a semantic conflict: a conflict in meaning, not text.

### Signature drift

Blocking A changed signature. A required parameter is added while a new caller elsewhere still passes the old arguments.

PR A, billing.ts: `function charge(total, currency)` PR B, checkout.ts: `charge(order.total)` Result: `currency argument missing`

### Broken reference

Blocking A renamed helper leaves a caller behind. A helper is renamed on one branch while another branch adds a call to its old name.

PR A, format.ts: `formatAmount → formatMoney` PR B, invoice.ts: `formatAmount(total)` Result: `formatAmount is no longer defined`

### Deleted dependency

Blocking A removed definition is still called. One change removes a definition that a different change still calls.

PR A, tax.ts: `- function legacyTax(cart)` PR B, checkout.ts: `legacyTax(cart)` Result: `call to a removed definition`

### Duplicate definition

Review Two additions, one name. Two separate additions create the same fully qualified name. Ambiguous cases go to review.

PR A, retry.ts: `export const RETRY_LIMIT = 3` PR B, retry.ts: `export const RETRY_LIMIT = 5` Result: `RETRY_LIMIT defined twice`

### Data flow

Advisory A changed policy reaches another reader. A changed policy value alters what another change reads.

PR A, policy.ts: `maxRetries = 0` PR B, sync.ts: `for (i < policy.maxRetries) retry()` Result: `sync now never retries`

### Confluence

Advisory Two edits feed one total. Independent edits, such as one to a price and one to a fee, feed into the same total.

PR A, price.ts: `price = base * 1.10` PR B, fees.ts: `serviceFee = 4.00` Result: `both change order.total`

### Override

Advisory A value replaced before it is used. Writes on interacting paths can replace a value before it is ever read.

PR A, session.ts: `user.locale = detectLocale()` PR B, boot.ts: `user.locale = "en"` Result: `detected locale is overwritten`

### Textual conflict

Must resolve Two edits. One conflicting line. Two changes replace the same text in different ways. Git reports this one too; it shares the same queue.

PR A, config.ts: `timeout: 30` PR B, config.ts: `timeout: 45` Result: `same line, different text`

01 / Code graph

### Read the code under every open PR.

Deep static analysis maps where each name is defined and who calls it across open pull requests. These connections form the foundation for finding conflicts, planning the queue and resolving them.

02 / Data and control flow

### Find the conflicts Git misses.

Data and control flow reveal how changes in one pull request affect another. Merget uses that map to detect semantic conflicts that Git merges cleanly, alongside the textual conflicts Git reports.

03 / PR graph

### Plan the queue. Resolve in parallel.

The PR graph shows which pull requests can land together and which must go in order. Merget resolves their conflicts in parallel: known shapes directly, and harder cases with coding agents. Every fix lands through your required checks and reviews.

[How Merget resolves conflicts between agents](https://merget.ai/ai-coding-agents)

## See why two PRs conflict, down to the method.

Directory → methodFind the shared method.Open a directory to see the methods two pull requests both touch.

## The graph finds the conflicts. The queue resolves them in order.

Merget runs its own merge queue on GitHub. Pull requests join on their own, and each one is resolved against the pull requests ahead of it.

Order

### Queue positions decide what lands first

The graph shows which pull requests conflict; it does not reorder them. Independent changes go first, and among equals the older pull request goes first.

Resolution

### Fixed against what lands ahead

Each conflict is resolved against the result of the pull requests ahead, with the graph’s definitions and callers as context.

Joining

### No enqueue command

No label, comment or command is needed. Stacked pull requests work without a stacking tool, at any depth.

Landing

### Batched, then verified

In Queue and Autonomous, ready pull requests are batched for CI, and main is verified after every merge.

## Start in Advisory. Move to Queue or Autonomous when you trust it.

Advisory reports conflicts without changing source code or merging pull requests.

## Semantic merge queue FAQ. Coverage, controls and getting started.

### Does the PR graph decide the merge order?

No. The PR graph shows which pull requests conflict; queue positions set the landing order. Merget resolves each change against the result of those ahead of it. [See how resolution works.](https://merget.ai/ai-coding-agents)

### Which languages and coding agents does Merget support?

Code analysis covers C, C#, Go, Java, JavaScript, Kotlin, Python, Rust, Scala and TypeScript. Coverage varies by language and build context; other files still receive Git textual conflict checks. Merget works with GitHub pull requests and connects to agents including Claude Code, Codex and Cursor through its plugin or MCP server. [Read the setup and coverage guide.](https://merget.ai/docs)

### Does it analyze the whole repository every time?

No. Per-file results are reused by Git blob identity, and deeper analysis focuses near changed behavior. Whole-tree analysis is configurable.

### Are behavioral findings bugs?

Not necessarily. Behavioral findings show where one pull request changes the effect of another. Precise findings can block under your settings; findings that need judgment stay advisory.

### What happens when a finding is ambiguous?

Merget reports ambiguous findings for review. Blocking a semantic conflict requires precise evidence, and an unresolved fix needs a person’s attention.

### Does Merget work with stacked pull requests?

Yes. Stacked pull requests work without a stacking tool, a label or a command, at any depth. In Queue and Autonomous modes Merget retargets the pull requests above one that lands.

### How do I start?

[Sign up](https://sema.merget.ai/login), install the GitHub App on one repository and review the findings in Advisory mode. [The setup guide](https://merget.ai/docs) covers each step, and you can [book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) to walk through it with us.
