# Merge Conflicts, Gone Merget's merge queue uses deep static analysis to detect, order and resolve your agents' conflicting pull requests [Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) [How Merget makes AI Agents 70% cheaper](https://merget.ai/benchmarks/merge-workloads#resolver) ## Connects to your AI Agents - Claude Code - Cursor - Codex - Devin - GitHub Copilot - Kiro - Google Antigravity - Replit Agent - Amp - Warp - OpenCode - Cline - Zed - [JetBrains Junie](https://www.jetbrains.com/) - Goose - Factory Droid ## Your agents ship good PRs. We still merge them like it’s 2010. ### Every merge into main multiplies your dev team’s workload. Each pull request that lands moves main. Every open PR behind it can now conflict or fail CI, and each one is rebased, resolved and rechecked on its own, then again after the next merge. ### Git can’t see every conflict. One pull request renames a function. Another adds a call to its old name. Git merges both cleanly. Every branch passes alone. Main doesn’t. ### Every PR wastes tokens and hours across your fleet of agents. Each agent resolves the same conflicts and CI failures on its own branch. The more pull requests are open, the more of that work is repeated. ## PRs from different agents conflict twice as often as PRs from the same agent. In a replay study, cross-agent pull request pairs hit textual conflicts at about twice the rate of same-agent pairs. Those are only the conflicts Git can see. Cross-agent pairs 41.7% Same-agent pairs 19.8% 716 evaluated pairs: 48 of 115 cross-agent pairs (41.7%) and 119 of 601 same-agent pairs (19.8%). [Xu et al., 2026 ↗](https://arxiv.org/abs/2607.04697) A separate study found textual conflicts in 27.67% of 107,026 simulated, unmerged agent PRs. [AgenticFlict ↗](https://arxiv.org/pdf/2604.03551) [See what Merget resolves in our benchmarks ↗](https://merget.ai/benchmarks) ## Merget reads the code under every open PR, plans the queue and resolves the conflicts in parallel. 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. [See how it works](https://merget.ai/how-it-works) ## Clear the merge queue in minutes, not hours. 28.9 sto plan a queue of 40 mergesFlask, 40 workers 5.9 minto work through a 24-branch batch, against 11.5 min for agents merging one at a timeFlask batch 2, median 7 → 2agent sessions on the same batch with the one-call resolversame branch outcomes $0.018modeled cost to resolve one conflicted file223 of 223 files resolved [See the benchmarks](https://merget.ai/benchmarks) ## Worktrees keep your agents apart. Merget resolves what collides when they merge. Worktrees stop agents overwriting each other while they work, but their pull requests still conflict at merge time. GitHub’s merge queue removes a conflicting pull request for you to fix. Merget resolves it in queue order, with the pull requests ahead in view. What it cannot resolve safely comes back to a person. ### Once their pull requests conflict, someone has to resolve them. | What you need | Merget | Resolve by hand | Ask the agent to fix it | GitHub merge queue | | --- | --- | --- | --- | --- | | Merge conflicts get resolved | Yes, in the queue | Yes, one rebase at a time | Yes, one pull request at a time | No, it removes the pull request | | Who does the work | The queue | You | You, re-prompting each agent | You, after it is removed | | Fixing one doesn’t break the next | Yes, each is resolved against the ones ahead | No, each fix targets today’s main | No, each fix targets today’s main | No, it can be removed again | | Catches conflicts Git merges cleanly | Yes, before CI runs | No, only what Git flags | No, it sees only its own pull request | Only if CI fails | GitHub merge queue behavior from [GitHub’s documentation](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue), checked November 17, 2026. [Compare GitHub merge queue alternatives](https://merget.ai/github-merge-queue-alternatives) ## Merge queues, merge conflicts and coding agents. ### What is Merget? Merget is a semantic merge queue for GitHub, built for teams running AI coding agents in parallel. It finds conflicts between open pull requests, resolves them in queue order, and lands the result through your required checks and reviews. [See how it works.](https://merget.ai/how-it-works) ### What is a semantic merge queue? A semantic merge queue is a merge queue that finds and resolves conflicts in what code means, not only in its text, before pull requests land. For example, one pull request renames a function while another adds a call to its old name. [Read the definition and example.](https://merget.ai/semantic-merge-queue) ### Does GitHub’s merge queue resolve merge conflicts? No. GitHub’s merge queue removes a pull request that conflicts with the base branch or fails required checks, and the author fixes it and queues again. Merget works on the conflict in queue order instead. [How GitHub’s merge queue works.](https://merget.ai/guides/github-merge-queue) ### Do I need GitHub’s merge queue to use Merget? No. Merget runs its own queue and manages its own landing order. No label, comment or enqueue command is needed, and branch protection is optional. It works with public and private repositories on GitHub.com, for organizations and personal accounts. [Read the setup guide.](https://merget.ai/docs) ### What are some alternatives to GitHub’s merge queue? Merget, Mergify, Graphite, Trunk and Aviator are alternatives to GitHub’s merge queue. They differ most in what happens when pull requests conflict: Merget resolves the conflict in queue order, where most queues remove the pull request. [Compare the alternatives.](https://merget.ai/github-merge-queue-alternatives) ### How do I stop merge conflicts between parallel Claude Code agents in git worktrees? Worktrees stop agents from overwriting each other’s files, but their branches still conflict when they merge. Keep each agent’s pull request small, then let a merge queue order and reconcile them: Merget resolves the conflicts between open pull requests in queue order, so no agent rebases by hand. [Read the worktree guide.](https://merget.ai/guides/claude-code-worktrees-merge) ### Why do pull requests pass CI and still break main? Because each pull request is tested against the main it branched from, not against the pull requests landing beside it. One renames a function while another adds a call to its old name; Git merges both cleanly and the build breaks. Merget finds these conflicts in meaning before the changes land. [See a worked example.](https://merget.ai/blog/why-a-clean-merge-can-still-break) ### Is there a tool that automatically resolves merge conflicts between pull requests? Yes. Merget resolves conflicts between open pull requests inside the merge queue. Known conflict shapes are resolved deterministically, harder cases go to a coding agent, and every resolution is checked before it is used. [See the conflict resolution benchmark.](https://merget.ai/benchmarks/conflict-resolution) ### 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. [See how it works.](https://merget.ai/how-it-works) ### Which coding agents and languages does Merget support? Merget works with GitHub pull requests from any agent. The plugin covers Claude Code, Codex, GitHub Copilot, Cursor, Devin, Kiro and Google Antigravity, and other clients connect through the MCP server. Code analysis supports C, C#, Go, Java, JavaScript, Kotlin, Python, Rust, Scala and TypeScript. [See coverage and agent setup.](https://merget.ai/docs#languages) ### Can I start without letting Merget change my code? Yes. Every repository starts read-only, in a mode called Advisory: Merget reports the conflicts it finds without changing source code or merging anything. You choose when it may resolve conflicts, and when it may land work. [See the three modes.](https://merget.ai/how-it-works#modes-overview) ### Will it respect our reviews and CI? Yes. Merget lands through your required checks and reviews and revalidates the target before landing. Overrides are separate, deliberate controls for authorized users. [Read about access and controls.](https://merget.ai/security) ### What access does the GitHub App need? The App reads the repositories you select and has write permissions for checks, pull requests, contents and administration. Additional Actions and Workflows permissions enable specific workflows. Advisory limits what Merget does, not the installation’s permission scope. [Review the full permissions.](https://merget.ai/docs#permissions) ### Where does our code go? Advisory makes no model requests. When Merget resolves conflicts, in Queue and Autonomous modes, conflict context and code a repair agent reads can be sent to a model service. In every mode, Merget may also train its own models on your code, after removing people's names and the credentials it finds. [Review the data flow.](https://merget.ai/security) ### What does Merget cost? The Free plan includes 5,000 credits per month. Team is $50 per month with 10,000 credits and no per-seat charge. Billing remains inactive for organizations in preview. [See plans, overage and spending caps.](https://merget.ai/pricing) ### How do I get started? [Sign up](https://sema.merget.ai/login), install the GitHub App on one repository and read the conflicts Merget finds. It changes no code until you turn that on. To talk through your agents and merge workflow first, [book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call). The coding-agent names and logos at the top of this page are trademarks of their owners, shown only to identify the agents that work with Merget. Merget is not affiliated with or endorsed by their owners. Copyright © 2026 [JetBrains s.r.o.](https://www.jetbrains.com/) Junie and the Junie logo are trademarks of JetBrains s.r.o. --- # 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. --- # Merge queue for AI coding agents. Claude Code, Codex and Cursor agents open pull requests faster than main can take them. Merget resolves the merge conflicts between them, so your agents keep building. [Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ## Keep your agents. Keep your Git workflow. Claude Code, Codex, Cursor and other coding agents keep working in their git worktrees, pushing branches and opening pull requests. Merget works from GitHub, with a plugin and MCP server for agents that need the queue’s context. ## Parallel agents, one main. Worktrees keep agents out of each other’s files. Their branches still meet at merge time. These guides cover the setup for each agent and what to do when the branches collide. To set up an agent, paste this into it: ``` Fetch and execute the instructions to set me up for Merget from https://sema.merget.ai/agent-setup/prompt.md ``` Claude Code ### Git worktrees [Merging git worktrees from parallel Claude Code agents.](https://merget.ai/guides/claude-code-worktrees-merge) Claude Code ### Agent teams [Claude Code agent teams: landing the pull requests.](https://merget.ai/guides/claude-code-agent-teams-pull-requests) Codex ### Worktrees and parallel tasks [Codex worktrees: merging parallel agent branches.](https://merget.ai/guides/codex-worktrees-merge) Cursor ### Worktrees and cloud agents [Cursor worktrees and cloud agents: landing the pull requests.](https://merget.ai/guides/cursor-worktrees-cloud-agents) Every agent ### Plugin and MCP server Claude Code, Codex, GitHub Copilot, Cursor, Devin, Kiro and Google Antigravity use the Merget plugin; other clients connect over MCP. [See agent setup.](https://merget.ai/docs#agents) ## Resolve known conflicts directly. Bring in an agent when the fix needs judgment. Resolved directly - Supported conflicts with a known shape. - Handled deterministically, without an agent. - Repeatable for every case it covers. - Validated before the change moves on. Sent to an agent - Harder cases that need judgment. - The agent uses a model, in Queue and Autonomous modes only. - The result faces the same validation. - Ambiguous or failed results stop for a person. ## Independent groups don’t wait for each other. Conflicting pull requests resolve against the code they will join. Groups that do not collide run alongside them. Candidates ### Symbol index Merget finds pull requests that touch connected symbols, then verifies which pairs conflict. In order ### Predicted target Inside a group, Merget resolves each pull request against the expected result of the pull requests ahead of it. Side by side ### Parallel groups Groups with no verified conflicts can resolve at the same time. Capacity ### Bounded workers Worker and memory limits set how many groups run at once. ## Resolve the conflict. Keep your merge requirements in control. Merget runs your required checks on the prepared result, follows your review rules and rechecks the actual target before landing. Resolving a conflict does not by itself make a pull request ready to merge. Stale work is checked again, and a fix that fails its checks comes back to a person. [Compare the automation modes](https://merget.ai/how-it-works#modes-overview) ## Parallel coding agent FAQ. Resolution, order and control. ### Which conflicts are resolved without an agent? Merget resolves supported conflicts with known shapes deterministically and uses agent assistance for harder cases. [See the resolution benchmark](https://merget.ai/benchmarks/conflict-resolution) and try it on your own pull requests in Advisory mode. ### What does an agent see when it resolves a conflict? The repair agent has a complete repository checkout. It can read files and run commands; code it reads and conflict context may be sent to a model service. Advisory mode makes no model requests. ### Does an agent’s fix skip review? No. An agent’s fix goes through the same validation, required checks and reviews as any other change. ### What happens when the target branch moves? Merget compares prepared work with the new target. If an assumption no longer holds, the work is prepared again. ### How much runs at once? Independent groups run within worker and memory limits. Conflicting pull requests inside one group resolve in queue order. ### Do I have to change how my agents work? No. Agents keep pushing branches and opening pull requests on GitHub. No label, comment or enqueue command is needed, and stacked pull requests work without a stacking tool. ### How do I connect my coding agent to Merget? Paste the setup prompt on this page into the agent, or install the Merget plugin. It gives the agent the queue’s findings, order and status through an MCP server. [See agent setup.](https://merget.ai/docs#agents) ### How do I try it? [Sign up](https://sema.merget.ai/login) and connect one repository; it starts in Advisory mode. To talk through your agents and merge volume first, [book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call). --- # What is a semantic merge queue? A semantic merge queue is a merge queue that finds and resolves conflicts in what code means, not only in its text, before pull requests land. An ordinary merge queue tests changes together and removes the ones that fail. [Sign up free](https://sema.merget.ai/login)[See how Merget works](https://merget.ai/how-it-works) ## Git can merge the lines. The combined code can still break. A textual merge conflict happens when Git cannot combine edits to the same content. A semantic conflict, sometimes called a logical merge conflict, happens when the combined changes no longer work together, even though the text merges cleanly. Imagine two pull requests from the same main branch. The first renames an exported function and updates its existing callers. The second adds a new caller in another file. ### Pull request A: rename the function ``` // money.ts: formatAmount is renamed export function formatMoney(n) { return `$${n.toFixed(2)}`; } ``` ### Pull request B: add a new caller ``` // receipt.ts: new file import { formatAmount } from './money'; export const total = formatAmount(20); ``` Each pull request passes its own checks against the original main. They edit different files, so Git merges them without conflict markers. Together, the new import refers to a function that no longer exists, and main breaks. The fix keeps the rename and updates the new caller to `formatMoney`. Writing it requires knowing how the two changes relate. ## Find the conflict. Resolve it where the changes meet. 01 · Map ### Connect the affected code. Merget’s PR graph follows definitions, callers and behavior across open pull requests, revealing conflicts beyond overlapping text. 02 · Resolve ### Work in the queue’s actual order. Merget prepares each pull request against main and the changes ahead of it. Deterministic rules and coding agents resolve conflicts; what cannot be resolved safely returns to a person. 03 · Land ### Check the assembled result. Merget checks its resolutions, then lands the result through your CI, review requirements and landing policy. ## What a semantic merge queue adds to a merge queue. | Feature | Semantic merge queue | Merge queue | | --- | --- | --- | | Resolves merge conflicts | Yes | No: the pull request is removed | | Finds clean merges that break the build | Yes | Only when CI fails on the combination | | Writes the fix | Yes | No: the author or their agent does | | Orders and tests pull requests before they land | Yes | Yes | [Compare GitHub merge queue alternatives](https://merget.ai/github-merge-queue-alternatives) ## Semantic merge queues and the checks you still need. ### What is a semantic conflict? A semantic conflict is a conflict in meaning, not text: two changes merge cleanly in Git and the combined code no longer works. A renamed function and a new call to its old name is the classic case. [See eight ways branches collide.](https://merget.ai/blog/eight-ways-branches-collide) ### How is a semantic merge queue different from a merge queue? A merge queue validates changes in sequence or in batches and removes the ones that fail. A semantic merge queue also analyzes how the changes relate in code and resolves their conflicts as part of preparing them. [Compare merge queues.](https://merget.ai/github-merge-queue-alternatives) ### Does a semantic merge queue replace CI? No. CI tests the combined result; code analysis explains how changes conflict and guides the fix. Merget uses both, and your required checks decide what lands. ### Why does this matter for parallel coding agents? Each agent can produce a correct pull request without knowing what another agent changed. A semantic merge queue reconciles those changes before they land, so agents spend less time rebasing and repairing each other’s work. [Merge queue for AI coding agents.](https://merget.ai/ai-coding-agents) ### Can I see the conflicts before allowing any changes? Yes. Merget starts in Advisory mode, which reports findings and suggests an order without changing source code or branches. [Read the setup guide](https://merget.ai/docs) or [sign up free](https://sema.merget.ai/login). --- # GitHub merge queue alternatives. Merget, Mergify, Graphite, Trunk and Aviator are alternatives to GitHub’s merge queue. They differ most in what happens when pull requests conflict: Merget resolves the conflict in queue order instead of sending the pull request back. [Sign up free](https://sema.merget.ai/login) [See how Merget works](https://merget.ai/how-it-works) ## Merget resolves the conflicts other merge queues send back. | Feature | Merget | GitHub merge queue | Mergify | Graphite | Aviator | | --- | --- | --- | --- | --- | --- | | Resolves merge conflicts in the queue | Yes | No | Mechanical conflicts only, in Preview | No | No | | Finds conflicts Git merges cleanly, before CI runs | Yes | No | No | No | No | | Who fixes a conflict | The queue | The author | The author, unless it is mechanical | The author | The author | | Orders and tests pull requests before they land | Yes | Yes | Yes | Yes | Yes | | Batches pull requests for CI | Yes | Yes | Yes | Yes | Yes | From each vendor’s public documentation, checked November 13, 2026: [GitHub](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue), [Mergify](https://docs.mergify.com/merge-queue/conflict-resolution/), [Graphite](https://graphite.com/docs/get-started-merge-queue), [Aviator](https://docs.aviator.co/mergequeue). ## What each merge queue’s documentation says about conflicts. | Merge queue | What it handles | When changes conflict | | --- | --- | --- | | Merget | Code analysis across open pull requests, conflict resolution and coordinated landing. | Resolves the conflict in queue order, using the definitions, callers and behavior of the pull requests ahead. Checks the fix before landing through your required checks and reviews. What it cannot resolve safely returns to a person. [How it works](https://merget.ai/how-it-works). | | GitHub merge queue | Native queueing and required checks against the target branch plus queued changes. | Removes a pull request when it conflicts with the base branch or fails required checks. [GitHub documentation](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue). | | Mergify | Configurable queueing and batching, plus Conflict Resolution, a Preview feature available on request. | Its resolvers merge mechanical conflicts by structure: lockfiles, changelogs and source files such as Python imports and functions. The same line changed two ways, or a function both pull requests rewrote, goes to a person, and an unresolved pull request leaves the queue. [Mergify documentation](https://docs.mergify.com/merge-queue/conflict-resolution/). | | Graphite | Stack-aware queueing, parallel CI and batching. | Rebases stacked changes; a pull request with failing checks or merge conflicts is removed from the queue. [Queue overview](https://graphite.com/docs/graphite-merge-queue) and [using the queue](https://graphite.com/docs/get-started-merge-queue). | | Trunk | Queue validation and retries for some transient failures. | For a merge conflict that prevents a test branch, its documented recovery is to resolve the conflict by rebasing or merging the target, then requeue. [Trunk documentation](https://docs.trunk.io/merge-queue/using-the-queue/handle-failed-pull-requests). | | Aviator MergeQueue | Tests queued changes together before merging them into the target branch. | Reports failures such as a failed required check and removes the pull request from the queue. [Aviator documentation](https://docs.aviator.co/mergequeue). | Vendor behavior checked against the linked documentation on November 13, 2026. Configuration matters; this compares documented workflows, not a performance test of these products. ## A queue can find a failing combination. Merget also fixes it. Merge queues test pull requests against the changes ahead of them. That protects a busy main branch. When the combination fails, someone still has to understand the conflict and write the fix, and with coding agents that someone is usually another agent run and another round of CI. Merget puts that work inside the merge queue. Its PR graph follows definitions, callers and behavior across branches, so it also sees a semantic conflict, a conflict in meaning: one pull request renames a function while another adds a call to its old name, even though Git merges the text. Deterministic rules resolve known conflict shapes and a coding agent handles harder ones. Every resolution is checked before it is used. [See the resolution workflow](https://merget.ai/how-it-works) or [the conflict resolution benchmark](https://merget.ai/benchmarks/conflict-resolution). ## Merget is its own merge queue. It does not depend on GitHub’s. Any repository ### Public and private, on GitHub.com Install the GitHub App for an organization or a personal account and choose the repositories. Joining ### No enqueue command Pull requests join the queue without a label or comment. Branch protection is optional. Stacks ### Stacked pull requests as they are No stacking tool is needed, at any depth. Control ### Start in Advisory Review findings while Merget changes no source code. Add resolution and landing per repository. ## Choosing a merge queue for GitHub. ### What are some alternatives to GitHub’s merge queue? Merget, Mergify, Graphite, Trunk and Aviator are alternatives to GitHub’s merge queue. Each queues and tests pull requests before they reach the target branch; they differ in batching, stacking and what happens when pull requests conflict. ### Is GitHub’s merge queue enough? It can be. If native queueing and your CI already cover your workflow, GitHub’s merge queue may be all you need. If parallel agents keep returning to rebase and repair each other’s pull requests, that is the work Merget is built to take on. [How GitHub’s merge queue works.](https://merget.ai/guides/github-merge-queue) ### Does Mergify resolve merge conflicts? Partly. Mergify’s Conflict Resolution is a Preview feature that merges mechanical conflicts, such as lockfiles and changelogs, by structure. Its documentation says the same line changed two ways, or a function both pull requests rewrote, still goes to a person. ### Which merge queue is built for AI coding agents? Merget is built for pull requests from parallel coding agents. Agents raise the number of pull requests that collide, so Merget resolves those conflicts in queue order and works on independent groups in parallel. [Merge queue for AI coding agents.](https://merget.ai/ai-coding-agents) ### Can I use Merget on a branch that uses GitHub’s merge queue? Yes, with manual merging. On a branch that uses GitHub’s native merge queue, Merget still prepares pull requests and you merge through GitHub’s queue. To let Merget land work itself, remove GitHub’s merge queue rule from that branch. ### How do I try Merget? [Sign up](https://sema.merget.ai/login), install the GitHub App on one repository and review the findings in Advisory mode. [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) if you want to walk through your current queue first. --- # Set up your semantic merge queue. Connect the Merget GitHub App, choose a repository, and start in Advisory. See how your pull requests conflict before turning on resolution and automatic landing. [Sign up free](https://sema.merget.ai/login)[Review App permissions](#permissions) ## One repository. A clear view of what will collide. 1. [Sign up](https://sema.merget.ai/login) or [log in](https://sema.merget.ai/login) with GitHub, Google or email, and open the right Merget organization. An organization owner connects the GitHub App; GitHub must also let that person install or administer it. 2. In Merget, open Settings › GitHub and choose Add GitHub organization. Personal GitHub accounts work too. 3. On GitHub, choose Only select repositories, pick your first repository, review the permissions, and install. 4. Return to Merget and enable the repository. Newly connected repositories start disabled and in Advisory mode. 5. Review findings on your open pull requests. Configure checks and reviews before moving to Queue or Autonomous. Merget supports public and private repositories on GitHub.com. GitHub Enterprise Server, other GitHub domains, GitLab and Bitbucket are not supported today. ## Start with findings. Add resolution when you are ready. ### Advisory Analyzes pull requests and suggests an order. It posts checks and comments, but changes no source code or branches and makes no model requests. A blocking finding can fail a required Merget check. With Administration access, Merget may rename a legacy required check from `sema` to `Merget`. ### Queue Also resolves conflicts and publishes prepared fixes when needed. You choose when to merge, in GitHub or through an offered dashboard action. ### Autonomous Also starts ready merges automatically under the repository’s configured requirements. Required checks and reviews apply by default; explicit overrides and push-based batch landing need a deliberate policy review. [Compare the modes](https://merget.ai/how-it-works#modes-overview) and read the [landing controls](#landing-controls) before enabling writes. Pull Merget’s commits before pushing more work to a branch it has updated. ## Know what Merget can access before you install. | Permission | Access | Purpose | | --- | --- | --- | | Checks | Read and write | Posts the Merget check and reads other check results. | | Pull requests | Read and write | Reads PRs and posts review comments. Queue and Autonomous can resolve Merget’s own obsolete review threads and retarget stacks; Autonomous can merge. | | Contents | Read and write | Reads code for analysis and optional builds. Writes in Queue and Autonomous publish fixes, manage temporary branches and land batches. | | Administration | Read and write | Reads protections and rulesets; can turn off strict up-to-date protection after an owner confirms. May rename the legacy required `sema` check in every mode. With Actions access, reads repository runner availability after observing batch jobs. | | Actions | Write, when granted | Cancels obsolete batch workflow runs when configured. Read access supplies batch job timing; without it, Merget reads check runs. | | Workflows | Write, when granted | Lands a PR’s own workflow change when merging it creates workflow content not already on your branches. Merget’s fixes do not edit workflow files, and fork workflow changes need a person to merge. | | Commit statuses | Read | Reads CI results reported as commit statuses. | | Metadata | Read | Reads basic repository information required by GitHub Apps. | | Members (organization) | Read | Reads organization and team membership, including teams named in CODEOWNERS when Merget checks code-owner review. | You choose the repositories the App can access. Private build dependencies need a separate explicit grant; selecting all repositories does not grant dependency access by itself. Disabling a repository stops new Merget work but retains its settings and data. Uninstall the App on GitHub to revoke its GitHub access. [Read about data and security](https://merget.ai/security). ## Choose the landing path deliberately. By default Merget lands through GitHub’s merge path, where your required checks and reviews apply. Authorized users can explicitly override a blocked merge, and Autonomous repositories can opt into landing on Merget’s verdict. A fast-forward push requires the App to have bypass access. On that path Merget checks approvals, code-owner review, latest-push approval, resolved review threads and required checks itself. On a bypass push, Merget does not evaluate file-specific required reviewers, required deployments or workflows, code scanning, or commit and file restrictions. Keep these rules outside the App’s bypass scope or use GitHub’s merge path. A fix held in the combined queue result can land in a batch without appearing on a reviewed pull request head. If a branch uses GitHub’s native merge queue, Merget still prepares pull requests and you merge through GitHub’s queue. [Read about security and controls.](https://merget.ai/security) ## Code analysis for ten languages. Textual conflicts in every repository. | Language | Extensions | | --- | --- | | C | `.c, .h` | | C# | `.cs` | | Go | `.go` | | Java | `.java` | | JavaScript | `.js, .jsx, .mjs, .cjs` | | Kotlin | `.kt, .kts` | | Python | `.py` | | Rust | `.rs` | | Scala | `.scala, .sc` | | TypeScript | `.ts, .tsx` | Extension matching ignores case. C++ is not included; `.h` files are read as C. Extensions such as `.mts`, `.cts`, `.pyi`, `.pyw` and `.csx` are not covered. Coverage varies by language and construct. Cross-language calls, dynamic behavior and build-specific C headers can limit analysis. Argument-count checks do not cover every type incompatibility. Generated or minified files receive no code findings. Use each run’s Coverage report alongside your CI and review. Unsupported files still enter the queue and receive textual-conflict reporting; your CI can verify their fixes. ## Bring your agent. Give it the queue’s context. Claude Code, Codex, GitHub Copilot, Cursor, Devin, Kiro and Google Antigravity can use the Merget plugin. Other clients that support remote MCP, including Replit Agent, can connect to the same service. The [Merget plugin](https://github.com/MergetAI/merget-plugin) bundles the MCP server and skills. For a client without plugins, connect its remote MCP settings to `https://sema.merget.ai/mcp`. Use one connection path to avoid duplicate tools. You sign in through the browser and approve an organization and permissions. Agents act through your access; organization and repository controls can restrict them. They cannot grant themselves ownership or expand their own permissions. To set up an agent in one step, paste this into it: ``` Fetch and execute the instructions to set me up for Merget from https://sema.merget.ai/agent-setup/prompt.md ``` [Review pricing](https://merget.ai/pricing), [sign up free](https://sema.merget.ai/login), or read the [Markdown version of these docs](https://merget.ai/docs.md). --- # Access, data and controls. Merget installs as a GitHub App on the repositories you choose. See what it can access, where code is processed, and the controls you keep. [Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ## See the conflicts first. Then let Merget resolve them. A newly connected repository starts disabled and in Advisory mode. Enable it to see findings before allowing any source-code change or merge. Move a repository to Queue or Autonomous when you are ready. Each repository keeps its own mode. ## You choose the repositories. Install the GitHub App on selected repositories, and remove access when you need to stop. GitHub App ### Installed by you Install the GitHub App on a GitHub.com organization or personal account. Public and private repositories are supported. Repository scope ### Selected by you Choose which repositories the App can read. Merget reads code, pull requests, checks, reviews and branch rules. [Review the App permissions.](https://merget.ai/docs#permissions) Sign-in ### Two-factor for every account Sign in with GitHub, Google or email. Two-factor authentication is required, and being a Merget owner does not grant access to private GitHub repositories. ## Keep your merge requirements in control. Merget lands through your required checks and reviews and rechecks the target before landing. Overrides are separate decisions for authorized users. Reviews ### Required reviews On GitHub’s merge path, Merget waits for the reviews your branch rules require. Landing by push is opt-in and has its own checks. Checks ### Required checks Merget waits for required checks on the prepared result. Final merge ### The final merge In Queue mode a person approves the merge. Autonomous mode lands work through the configured merge requirements. Owners ### Owner controls Organization owners can stop new automatic merges from starting. Overrides ### Deliberate, never implied Authorized users can explicitly override a blocked merge, and a repository can opt into further landing paths. [Read the landing controls.](https://merget.ai/docs#landing-controls) ## Know where your code goes. Advisory makes no model requests. Merget asks a model service about your code only to resolve conflicts, in Queue or Autonomous mode. Separately, in every mode, Merget may train its own models on your code, after removing people's names and the credentials it finds. Advisory - Analyzes code and reports conflicts. - No source-code changes or merges. - No model requests. - Analysis runs none of your code. Queue and Autonomous - A repair agent can read the repository checkout. - Code it reads and conflict context can reach the model service. - Each preparation runs in an isolated environment. - You choose the mode per repository. ## Our SOC 2 audit is in progress. Tell us what your security review needs and we will share where we are. [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) Removal ### Code copies erased on uninstall Uninstalling the GitHub App schedules repository copies, code graphs and build caches for deletion within minutes, and takes your code out of Merget's training data within 30 days. Payments ### Handled by Stripe Merget never sees your card number. Hosting ### GitHub.com repositories Merget is a hosted service for repositories on GitHub.com. Policies ### Terms, privacy and disclosure Read the [Terms of Service](https://merget.ai/legal/terms-of-service), the [Privacy Statement](https://merget.ai/legal/privacy-statement) and the [Vulnerability Disclosure Policy](https://merget.ai/legal/vulnerability-disclosure). Report a vulnerability to the contact in [security.txt](https://merget.ai/.well-known/security.txt). ## You bring the workflow. We bring the queue. Bring your repositories, CI checks, review rules and the agents you run. We will walk through access, the right starting mode and how far automation should go. [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ## Security FAQ. Access, data and controls. ### Is Merget SOC 2 certified? Not yet. Our SOC 2 audit is in progress. Tell us if your security review needs the report. ### Is our code sent to a model? To answer a request, only when Merget resolves conflicts: in Queue and Autonomous modes a repair agent can read the repository checkout, and code it reads may be sent to a model service. Advisory mode makes no model requests. Separately, Merget may train its own models on your code in every mode (next question). ### Does Merget train models on our code? It may train its own models on it. From November 17, 2026, Merget may train and improve its own models on repository contents, its findings and resolutions, and records of how the product is used, in every mode, unless a signed agreement says otherwise. It first removes the names, email addresses, logins, account identifiers and credentials it finds, never takes the stored values of your validation secrets into training data, and never gives your code to another customer. The model service Merget uses does not train its own models on your code. Deleting your organization or removing a repository from the installation takes its data out of training data within 30 days; turning a repository off does not. Models already trained are kept. [How Merget trains its models](https://merget.ai/legal/privacy-statement#model-training). ### How do I turn Merget off? Disable a repository in Merget to stop new work, or uninstall the GitHub App on GitHub to revoke its access. Organization owners can also pause new automatic merges. ### What happens to our code when we remove access? Uninstalling the GitHub App schedules repository copies, code graphs and build caches for deletion within minutes. Removing individual repositories from an installation clears those copies within seven days. Either takes the repository's data out of Merget's training data within 30 days. Run records have separate retention periods; backups follow their own retention. ### Will Merget bypass our reviews or CI? No. Merget lands through your required checks and reviews. An override is an explicit action by an authorized user, and further landing paths are opt-in per repository. [Read the landing controls.](https://merget.ai/docs#landing-controls) ### Do you offer SSO or an SLA? Not today. Sign-in is through GitHub, Google or email, with two-factor authentication required for every account. Tell us your identity and support requirements when you [book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call). ### Can it run on our own infrastructure? Not today. Merget is a hosted service for repositories on GitHub.com. Tell us your infrastructure and data-residency requirements. ### What does Merget cost? Merget has a Free plan and a Team plan billed by usage, with no per-seat charge. [See plans and billing.](https://merget.ai/pricing) --- # Start merging for free. Find conflicts between your agents’ pull requests before they reach main. Get 5,000 free credits every month. [Start free](https://sema.merget.ai/login) [Compare plans](#plans) ## Choose your plan. ### Free $0 / month 5,000 credits per month - 3 enabled repositories - Up to 5 members - 30 days of analytics history - Optional extra credits at $0.0075 each [Start free](https://sema.merget.ai/login) ### Team $50 / month 10,000 credits per month - Unlimited repositories - Unlimited members - Full analytics history - Extra credits at $0.005 each [Start on Free](https://sema.merget.ai/login) ### Enterprise Coming soon Pooled credits, custom spending caps and invoicing. [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ## A receipt for every pull request. Analysis and preparation use credits based on the work each run takes. Open a pull request’s receipt to see what ran, why it ran and how many credits it used. [See how the queue works](https://merget.ai/how-it-works) Example receipt #248 Checkout currency picker | Queue work | Credits | | --- | --- | | Analyze changes | 12 | | Prepare merge | 6 | | Revalidate before landing | 0 | | Land on main | 1 | | Total | 19 | ## Pricing questions [Read the billing terms](https://merget.ai/legal/billing-terms) ### How many pull requests will 5,000 credits cover? It depends on the work each pull request needs. Analysis, preparation and fix attempts use credits based on time and resources. Revalidation before landing is free, and a landing costs one credit. Each pull request has an itemized receipt, so you can use your first repository to see what’s typical for your team. ### What happens when I connect my first repository? Merget starts in Advisory mode and reports conflicts between open pull requests. You decide when it can resolve conflicts or land changes. [Read the setup guide](https://merget.ai/docs). ### What happens when I reach my credit limit? With live billing, Free pauses new analyses and preparations at 5,000 credits unless an owner enables extra credits. The default monthly cap is 10,000 credits with Free extras enabled and 20,000 on Team, including the bundle. Owners can change either cap or remove Team’s cap. Work in progress can finish, and certified merges and queue planning can still incur charges beyond the cap. ### Do failed runs use credits? Runs Merget fails or abandons cost zero credits. Fix attempts are charged for the work performed, even if they produce no fix. A run interrupted by your own push is also charged. Your pull request’s receipt shows the cause and cost of each run. ### When do credits renew? Credits renew on the first of every month, UTC. Unused credits expire at the end of the month. ### How do I upgrade to Team? Every new organization starts on Free. An owner can choose Team under Settings › Billing when the upgrade is available. The upgrade takes effect immediately and includes the full monthly allowance of 10,000 credits. --- # Claude Code agent teams: landing the pull requests Agent teams coordinate the work between Claude Code sessions, not the merge. Set a team up, avoid overwrites, and land what it produces. Merget team · Nov 13, 2026 · 5 min read Claude Code agent teams let one lead session coordinate several teammates through a shared task list and messages. Give each teammate its own files and end each stream of work in its own pull request. A team coordinates only its own sessions, so its pull requests still have to merge alongside everyone else’s. ## What an agent team is An agent team is several Claude Code sessions working together. One session is the team lead: it creates tasks, assigns them and synthesizes results. Teammates work independently, each in its own context window, and message each other directly. See the [agent teams docs](https://code.claude.com/docs/en/agent-teams). Agent teams are experimental and off by default. Turn them on with an environment variable in `settings.json`: ``` { "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" } } ``` Then describe the task and the teammates you want in plain language. The docs suggest starting with 3 to 5 teammates, and note that a team uses significantly more tokens than a single session. ## Teams, subagents or worktree sessions | Option | How it works | Use it for | | --- | --- | --- | | Subagents | Helpers inside one session that report back to it. | Focused tasks where only the result matters. | | Agent teams | Separate sessions with a shared task list and direct messaging. | Work that needs discussion and coordination between agents. | | Worktree sessions | Independent sessions you start yourself, each on its own branch. | Parallel implementation that ends in separate pull requests. | The docs list a few limits worth knowing before you rely on a team: a session has one team, teammates cannot spawn their own teammates, and resuming a session does not restore in-process teammates. ## Inside the team: give each teammate its own files The docs are direct about the main hazard: “Two teammates editing the same file leads to overwrites.” Break the work so each teammate owns a different set of files, and keep tasks self-contained: a module, a test file, a review. - Split by layer or module, so frontend, backend and tests each go to one teammate. - For larger pieces of implementation, run separate sessions in [git worktrees](https://merget.ai/guides/claude-code-worktrees-merge) so each has its own checkout and branch. - Ask the lead to wait for teammates to finish before it starts integrating. ### A prompt that sets file ownership ``` Create an agent team for the billing refactor. Spawn three teammates: - api: owns src/api/ only - ui: owns src/ui/ only - tests: owns tests/ only No teammate edits files outside its area. Wait for all three before you integrate, then run the full test suite. ``` Naming each teammate and its files in the prompt gives the lead clear tasks to assign and gives you names to refer to later. If two areas must change together, give both to one teammate. ## Between teams: the pull requests still meet at main A team coordinates the sessions inside it. It knows nothing about the other pull requests open against the repository: the ones from your colleagues, their agent teams, and yesterday’s sessions. Once everyone runs coding agents, pull requests arrive faster than they merge, and each one that lands moves main for the rest. Two things go wrong. Pull requests that touch the same lines conflict in text and wait for a rebase. Pull requests that touch related code, such as a renamed function and a new call to its old name, merge cleanly and break the build. Both send someone, usually another agent session, back to repair work that was already finished. ## Landing the pull requests 1. Keep each pull request to one task. A team’s output can be several pull requests. 2. Run your required checks on the combined result, not only on each branch. 3. Land the pull request that changes shared code first, such as a rename or a changed function signature, then update the others once. 4. Put a merge queue in front of main so pull requests are ordered and tested together. When a pull request falls behind, the quickest repair is usually a fresh session on that branch, not the original team. Ask it to merge the latest main, resolve the conflicts so both changes survive, and run the full test suite. ## What a team costs, and where merge conflicts add to it Each teammate is a separate Claude Code instance with its own context window, so token use grows with the size of the team. That is worth it when teammates work independently. It is wasted when a finished pull request has to be reopened because another one landed first: the repair is one more session on top of the team that already ran. See [what merge conflicts cost](https://merget.ai/guides/cost-of-merge-conflicts-ai-coding-agents). ## Questions ### How do I enable agent teams in Claude Code? Set `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` to `1` in your environment or in the `env` block of `settings.json`. The feature is experimental and disabled by default. ### Do agent teams prevent merge conflicts? Inside a team, file ownership prevents overwrites. Between pull requests from different teams, sessions and developers, conflicts still happen at merge time. ### What is the difference between agent teams and subagents? Subagents work inside one session and report back to it. Teammates are separate sessions that share a task list and message each other. ### How many teammates should a team have? The Claude Code docs suggest starting with 3 to 5 teammates for most workflows. ## When several teams land on the same main One team a day needs nothing more than the steps above. Once several developers each run teams and worktree sessions, pull requests arrive faster than they merge, and the repair sessions start to cost as much as the work. [Merget](https://merget.ai/how-it-works) is a merge queue for GitHub built for that. It looks across every open pull request, whichever team or person opened it, finds the ones that collide, including the ones Git merges cleanly, and resolves the conflicts in the order the pull requests will land. Each fix is checked and put on the original pull request, and the result lands through your required checks and reviews. What it cannot resolve safely comes back to a person. It starts in Advisory mode, which reports which of your open pull requests collide and changes no code. Try Merget on one repository for free, or talk it through with us first. [Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ### Merging git worktrees from parallel Claude Code agents Claude Code’s --worktree flag gives each session its own checkout and branch. Set them up, land the branches, and stop them colliding at merge time. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-worktrees-merge) ### Codex worktrees: merging parallel agent branches Codex runs each chat in its own git worktree so parallel tasks do not interfere. Turn the worktrees into pull requests and land them together. Merget team · Nov 13, 2026 · 4 min read [Open](https://merget.ai/guides/codex-worktrees-merge) ### Cursor worktrees and cloud agents: landing the pull requests Cursor runs agents in git worktrees on your machine and in cloud VMs that push branches. See how both work and how to keep the pull requests landing. Merget team · Nov 13, 2026 · 4 min read [Open](https://merget.ai/guides/cursor-worktrees-cloud-agents) [All guides](https://merget.ai/guides) --- # Merging git worktrees from parallel Claude Code agents Claude Code’s --worktree flag gives each session its own checkout and branch. Set them up, land the branches, and stop them colliding at merge time. Merget team · Nov 13, 2026 · 5 min read Start each Claude Code session with `claude --worktree ` so it gets its own checkout and branch, and open one pull request from each branch. Worktrees stop sessions overwriting each other’s files. They do not stop the branches conflicting when they merge, so decide how the pull requests will land before you start five of them. ## What a worktree gives a Claude Code session A git worktree is a separate working directory with its own files and branch, sharing one repository history. Claude Code creates one for you: ``` claude --worktree feature-auth # in a second terminal claude --worktree fix-logout ``` By default each worktree is created under `.claude/worktrees//` at the repository root, on a new branch named `worktree-`. Leave the name off and Claude Code generates one. New worktrees branch from the repository’s default branch; set `worktree.baseRef` to `"head"` to branch from your current work instead. See the [Claude Code worktree docs](https://code.claude.com/docs/en/worktrees). ## Set up each worktree once - Add `.claude/worktrees/` to `.gitignore` so worktree contents do not show up as untracked files. - List gitignored files a session needs, such as `.env`, in a `.worktreeinclude` file at the project root. Claude Code copies them into each new worktree. - Install dependencies in the worktree. It is a fresh checkout. - For subagents, add `isolation: worktree` to the subagent’s frontmatter, or ask Claude to “use worktrees for your agents”. ## Land each branch as a pull request When a session finishes, ask it to create a pull request. One pull request per worktree keeps changes small and reviewable. To pick up an existing pull request in its own worktree, run `claude --worktree "#1234"`. When you exit, Claude Code removes a clean worktree and its branch, and asks whether to keep one that still holds work. Use `git worktree list` to see what is left and `git worktree remove` to clean up by hand. ## A workflow for five or more sessions 1. Split the work into tasks that touch different areas of the code where you can. 2. Start one worktree session per task and name it for the task, so the branch and the pull request are easy to recognize. 3. Ask each session to run the tests in its worktree before it opens a pull request. 4. Keep each pull request to one task. Small pull requests conflict less and are quicker to review. 5. Exit finished sessions. Claude Code removes worktrees that have nothing left in them. Sessions can also pass findings to each other with cross-session messaging, which helps them avoid duplicate work. It does not change what happens at merge time: each branch was still written against an older main. ## Why the branches still conflict Every worktree branched from the same main. The first pull request to land moves main, and every other branch is now behind it. If two sessions touched the same lines, Git reports a textual conflict. If one renamed a function and another added a call to its old name, Git merges both cleanly and the build breaks. See [why a clean merge can still break main](https://merget.ai/blog/why-a-clean-merge-can-still-break). It is common with agents. In a replay study of agent pull requests, pairs from different agents hit textual conflicts in 41.7% of cases, against 19.8% for pairs from the same agent ([Xu et al., 2026](https://arxiv.org/abs/2607.04697)). ## Three ways to merge the worktrees | Approach | How it works | Where it strains | | --- | --- | --- | | Merge one at a time | Land a pull request, update the rest, rerun CI, repeat. | Every landing sends the other sessions back to update their branches. | | One integration session | A final Claude Code session merges every branch and fixes what breaks. | One long session holds all the context, and it starts again when main moves. | | A merge queue | Queues pull requests and tests them together before merging. | [GitHub’s merge queue](https://merget.ai/guides/github-merge-queue) removes a pull request that conflicts and hands it back to its author. | ## Landing them by hand: an order that works 1. Land the pull request that changes shared code first: renames, changed function signatures, schema changes. Everything else has to adapt to it anyway. 2. In each remaining worktree, ask the session to bring its branch up to date. A prompt for that is below. 3. Land the next pull request and repeat. 4. Stop starting new sessions while you do this. Each new pull request that lands moves main again. ``` Merge origin/main into this branch. Resolve any conflicts so that both changes survive. Then run the full test suite and fix anything that fails because main changed. Show me what you changed. ``` The test run matters as much as the merge. A session whose branch merges cleanly can still be calling something another session renamed. If your sessions use Codex or Cursor as well, the same approach applies. See the [Codex worktrees guide](https://merget.ai/guides/codex-worktrees-merge) and the [Cursor worktrees guide](https://merget.ai/guides/cursor-worktrees-cloud-agents). ## Questions ### Do git worktrees prevent merge conflicts? No. Worktrees isolate file edits while sessions run. The branches still conflict when they merge into main, because each started from the same commit. ### Where does Claude Code put worktrees? Under `.claude/worktrees//` at the repository root by default, each on a branch named `worktree-`. ### How many Claude Code sessions can I run in parallel? Each `claude --worktree` session is independent, so the practical limit is your machine and how fast the resulting pull requests can land. ### Should each worktree be its own pull request? Usually yes. Small pull requests are easier to review and quicker to update when main moves. ## When landing the branches becomes the bottleneck With two or three sessions a day, the manual order above is enough. With five or more running at once, most of your attention goes to the round of updates after every landing, and each update is another agent session and another CI run. [Merget](https://merget.ai/how-it-works) is a merge queue for GitHub that does that round for you. It finds the pull requests that collide, including the ones Git merges cleanly, resolves the conflicts in the order the pull requests will land, checks each fix, and puts it on the original pull request. A session is finished when its pull request is open. There is no label, comment or enqueue command, and nothing changes in how you use worktrees. What Merget cannot resolve safely comes back to a person. It starts in Advisory mode, which reports which of your open pull requests collide and changes no code. Try Merget on one repository for free, or talk it through with us first. [Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ### Claude Code agent teams: landing the pull requests Agent teams coordinate the work between Claude Code sessions, not the merge. Set a team up, avoid overwrites, and land what it produces. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-agent-teams-pull-requests) ### Codex worktrees: merging parallel agent branches Codex runs each chat in its own git worktree so parallel tasks do not interfere. Turn the worktrees into pull requests and land them together. Merget team · Nov 13, 2026 · 4 min read [Open](https://merget.ai/guides/codex-worktrees-merge) ### Cursor worktrees and cloud agents: landing the pull requests Cursor runs agents in git worktrees on your machine and in cloud VMs that push branches. See how both work and how to keep the pull requests landing. Merget team · Nov 13, 2026 · 4 min read [Open](https://merget.ai/guides/cursor-worktrees-cloud-agents) [All guides](https://merget.ai/guides) --- # Codex worktrees: merging parallel agent branches Codex runs each chat in its own git worktree so parallel tasks do not interfere. Turn the worktrees into pull requests and land them together. Merget team · Nov 13, 2026 · 4 min read In the Codex app, choose Worktree under the composer to run a chat in its own checkout. When the work is ready, use Create branch here, push the branch and open a pull request. Several Codex chats working in parallel produce several pull requests that all started from the same commit, so decide how they will land before you start them. ## How Codex uses worktrees A Codex worktree is a second checkout of your repository that shares the same Git metadata, so several chats can work on one project without interfering. In the new chat view, select “Worktree” under the composer, choose the starting branch, and submit the prompt. Codex creates the worktree. See the [Codex worktree docs](https://learn.chatgpt.com/docs/environments/git-worktrees). - Worktrees live under `$CODEX_HOME/worktrees` by default. Change the worktree root in Settings > Worktrees. - A worktree starts in detached HEAD at the head of the branch you chose. It is not a named branch yet. - List gitignored files a chat needs, such as `.env`, in a `.worktreeinclude` file at the repository root. - Codex keeps your 15 most recent managed worktrees by default and saves a snapshot before it deletes an older one. ## From worktree to pull request 1. Select “Create branch here” in the chat header to put the work on a named branch. 2. Commit and push the branch. 3. Open a pull request on GitHub. To continue in your main checkout instead, select “Hand off” and move the chat to Local. Git allows a branch to be checked out in only one place, so if you see `fatal: 'feature/a' is already used by worktree`, check out a different branch in one of them or use Hand off. ## Local and Worktree: foreground and background Codex describes Local as the foreground and Worktree as the background. Use Local for the task you are steering, and worktrees for tasks that can run on their own while you work. Scheduled tasks in a Git repository run on dedicated background worktrees. | | Local | Worktree | | --- | --- | --- | | Where it runs | Your main checkout | A separate checkout under the worktree root | | Branch | Whatever you have checked out | Detached HEAD until you select “Create branch here” | | Good for | The task you are working on now | Tasks that run in parallel or in the background | | Moving between them | Hand off to a worktree | Hand off to Local | ## A workflow for several Codex tasks 1. Start each task as a Worktree chat from the same up-to-date branch. 2. If the project needs setup, pick a local environment so its setup scripts run in the new worktree. 3. When a task is done, create a branch, push it and open a pull request. 4. Land the pull requests one at a time or through a merge queue, and update the remaining branches after each landing. ## Common snags - Missing local files. A new worktree has only tracked files. Add `.env` and similar files to `.worktreeinclude` so Codex copies them in. - No branch to push. A worktree starts in detached HEAD. Select “Create branch here” before you commit and push. - A branch that is already checked out. Git allows one checkout per branch, so move the chat with Hand off or switch the other checkout to a different branch. - A worktree that has gone. Codex keeps the 15 most recent managed worktrees and snapshots older ones, so reopen the chat to restore it. ## Where parallel Codex tasks collide Each chat started from the same commit. Once one pull request lands, the others are behind main. Edits to the same lines become merge conflicts. Edits to related code, such as a changed function signature and a new caller, merge cleanly and break the build. With several tasks running at once, each landing can send several chats back to repair their branches. ## Landing the branches together You can land them one at a time and update the rest, or put a merge queue in front of main. Land the pull request that changes shared code first, such as a rename or a changed function signature. Then, in each remaining chat, ask Codex to bring its branch up to date: ``` Merge origin/main into this branch. Resolve any conflicts so that both changes survive. Then run the full test suite and fix anything that fails because main changed. Show me what you changed. ``` A merge queue tests queued pull requests together before they merge, which catches the clean merges that break the build. [GitHub’s merge queue](https://merget.ai/guides/github-merge-queue) removes a pull request that conflicts, so that fix still comes back to the chat. Running Claude Code or Cursor alongside Codex? See the [Claude Code worktrees guide](https://merget.ai/guides/claude-code-worktrees-merge) and the [Cursor worktrees guide](https://merget.ai/guides/cursor-worktrees-cloud-agents). ## Questions ### Where does Codex store worktrees? Under `$CODEX_HOME/worktrees` by default. You can change the worktree root in Settings > Worktrees. ### Why is my Codex worktree in detached HEAD? Codex starts a worktree at a commit, not on a named branch. Use “Create branch here” in the chat header to create one. ### Do worktrees stop Codex tasks conflicting? They stop tasks overwriting each other’s files while they run. The branches can still conflict when they merge. ## When updating branches is most of the work A few Codex tasks a day land fine by hand. With many running in the background, each landing sends several chats back to update their branches, and every update is more model use and another CI run. [Merget](https://merget.ai/how-it-works) is a merge queue for GitHub that does those updates for you. It works from GitHub, so nothing changes in how you use Codex: a chat is finished when its pull request is open. Merget finds the pull requests that collide, including the ones Git merges cleanly, resolves the conflicts in the order the pull requests will land, checks each fix, and puts it on the original pull request. What it cannot resolve safely comes back to a person. It starts in Advisory mode, which reports which of your open pull requests collide and changes no code. Try Merget on one repository for free, or talk it through with us first. [Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ### Merging git worktrees from parallel Claude Code agents Claude Code’s --worktree flag gives each session its own checkout and branch. Set them up, land the branches, and stop them colliding at merge time. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-worktrees-merge) ### Claude Code agent teams: landing the pull requests Agent teams coordinate the work between Claude Code sessions, not the merge. Set a team up, avoid overwrites, and land what it produces. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-agent-teams-pull-requests) ### Cursor worktrees and cloud agents: landing the pull requests Cursor runs agents in git worktrees on your machine and in cloud VMs that push branches. See how both work and how to keep the pull requests landing. Merget team · Nov 13, 2026 · 4 min read [Open](https://merget.ai/guides/cursor-worktrees-cloud-agents) [All guides](https://merget.ai/guides) --- # What merge conflicts cost a team running AI coding agents Every merge conflict between agent pull requests costs tokens, CI minutes and developer attention. See where the cost comes from and how to measure yours. Merget team · Nov 13, 2026 · 4 min read A merge conflict between two agent pull requests costs an extra agent session to repair it, another CI run to check it, and a developer’s attention to restart both. Across a day of agent pull requests, those repairs add up to hours of waiting and wasted tokens. This guide shows where the cost comes from, how to measure it in your own repository, and what reduces it. ## Where the cost comes from AI coding agents open pull requests faster than a team can merge them. Merged one at a time, they collide: each pull request that lands moves main, and the ones behind it have to catch up. - Tokens. A developer sends an agent back to rebase and resolve. That is a full agent session for work that was already done once. - CI. The repaired branch runs its checks again, and so does every pull request queued behind it. - Attention. Someone notices the conflict, restarts the agent, reviews the repair and requeues the pull request. Conflicts between agents are common. In a replay study, pull request pairs from different agents hit textual conflicts in 41.7% of cases, against 19.8% for pairs from the same agent ([Xu et al., 2026](https://arxiv.org/abs/2607.04697)). A separate study found textual conflicts in 27.67% of 107,026 simulated agent pull requests ([AgenticFlict](https://arxiv.org/pdf/2604.03551)). Those are only the conflicts Git can see. ## Work out your own number The cost of one repair is one agent session, one CI run and a few minutes of someone’s attention. Multiply by how many repairs you do. Five figures from a normal week give you the answer: - Pull requests opened per day, and how many are open at once. - The share of pull requests that need a rebase or a conflict fix before they merge. - What one agent session costs you, from your model provider’s usage page. - What one CI run costs, in minutes and in money. - Time from approval to merge. As an example, a team that opens 40 pull requests a day and repairs a quarter of them pays for 10 extra agent sessions, 10 extra CI runs and 10 interruptions every day. The pull requests waiting behind each repair pay again in time. You can count repairs without new tooling. Search merged pull requests for merge commits from the base branch or for force-pushes after approval, or ask each developer to tally how often they sent an agent back to fix a branch in one week. ## Time is the larger cost Token spend is the visible line. The larger cost is the wait: a queue of pull requests that takes an afternoon to land, and developers pulled back into work they thought was finished. An agent that wrote a feature in ten minutes saves little if the pull request then sits for three hours behind other people’s repairs. ## How to cut the cost 1. Keep pull requests small, so conflicts are small and quick to repair. 2. Give agents separate [worktrees](https://merget.ai/guides/claude-code-worktrees-merge), so they do not overwrite each other while they work. 3. Split the work by area of the code before you start the agents. Two agents in the same module will collide. 4. Land the pull requests that change shared code first, then update the rest once. 5. Test the combination, not only each branch, with a merge queue. 6. Use the cheapest repair that works. A conflict with an obvious resolution does not need an agent that reads the whole repository. ## Where a merge queue helps, and where it does not A merge queue tests the combination that will land, so a break is caught before it reaches main and nobody pays for a red main. That removes one cost. It does not remove the repair: when a queued pull request conflicts, most queues remove it and hand it back, and the agent session, the CI run and the wait all happen anyway. See [how GitHub’s merge queue handles a conflict](https://merget.ai/guides/github-merge-queue). ## Questions ### How much does a merge conflict cost in tokens? It depends on your model and repository. In our benchmark, described below, repairing a conflict with a full agent session cost about $0.89 to $0.92 in modeled model spend, against about $0.018 for a single model call on the conflicted file. ### Why do AI coding agents cause more merge conflicts? They open more pull requests in parallel, each written without knowledge of the others. More pull requests against the same main means more of them collide. ### Does a merge queue reduce CI cost? It reduces wasted runs by testing the combination that will actually land. A queue that also resolves conflicts avoids the rebase-and-rerun cycle for conflicting pull requests. ## What we measured with Merget [Merget](https://merget.ai/how-it-works) is our merge queue for GitHub. It resolves conflicts in the queue instead of handing them back, so these figures are from our own product and our own benchmark. We replayed historical Flask branches through it with the same model and budget, with and without its one-call resolver. See the [merge workload benchmark](https://merget.ai/benchmarks/merge-workloads). | Measure | Result | | --- | --- | | Cost of one agent session | $0.89 to $0.92, modeled | | Cost of one resolver call | $0.0177, modeled | | Agent sessions on a 24-branch batch | 7 without the resolver, 2 with it | | Model spend on that batch | $3.60 without the resolver, $1.10 with it, modeled | | Median time for that batch | 478 s without the resolver, 354 s with it | Without the resolver, the 24-branch batch needed 7 agent sessions. With it, Merget made 7 resolver calls, which cost $0.12 to $0.18 in total, and needed only 2 agent sessions. The branches that landed were the same. Modeled spend fell by 69%, or 57% at list price, and the batch finished 26% sooner. In a separate benchmark the resolver handled [223 of 223 conflicted files](https://merget.ai/benchmarks/conflict-resolution) from real merges at about $0.018 each. Merget starts in Advisory mode, which reports the conflicts between your open pull requests and changes no code. That shows you which of your open pull requests collide, without changing how you merge. Try Merget on one repository for free, or talk it through with us first. [Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ### Merging git worktrees from parallel Claude Code agents Claude Code’s --worktree flag gives each session its own checkout and branch. Set them up, land the branches, and stop them colliding at merge time. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-worktrees-merge) ### Claude Code agent teams: landing the pull requests Agent teams coordinate the work between Claude Code sessions, not the merge. Set a team up, avoid overwrites, and land what it produces. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-agent-teams-pull-requests) ### Codex worktrees: merging parallel agent branches Codex runs each chat in its own git worktree so parallel tasks do not interfere. Turn the worktrees into pull requests and land them together. Merget team · Nov 13, 2026 · 4 min read [Open](https://merget.ai/guides/codex-worktrees-merge) [All guides](https://merget.ai/guides) --- # Cursor worktrees and cloud agents: landing the pull requests Cursor runs agents in git worktrees on your machine and in cloud VMs that push branches. See how both work and how to keep the pull requests landing. Merget team · Nov 13, 2026 · 4 min read Cursor isolates local agents in git worktrees and runs cloud agents in their own VMs, each on a separate branch. Bring worktree results back with `/apply-worktree` or a pull request, and let cloud agents push their branches. Every agent’s branch started from the same main, so decide how the pull requests will land before you start many of them. ## Worktrees in Cursor Cursor creates a separate checkout for an agent so several agents can work on one repository. In the Agents Window, start or move an agent into a worktree. In the editor, use the worktree commands. See the [Cursor worktree docs](https://cursor.com/docs/configuration/worktrees). ``` /worktree fix the failing auth tests and update the login copy /best-of-n sonnet,gpt,composer fix the flaky logout test /apply-worktree /delete-worktree ``` - `/worktree` runs the rest of the chat in a separate checkout. - `/best-of-n` runs one task across several models, each in its own worktree, so you can compare the results. - `/apply-worktree` brings the changes into your main checkout. You can also commit, push and open a pull request from the worktree. - `.cursor/worktrees.json` holds setup commands for new worktrees, such as installing dependencies and copying `.env` from `$ROOT_WORKTREE_PATH`. Cursor keeps up to 25 worktrees per machine by default and cleans up the oldest. ## Set up new worktrees automatically A worktree is a fresh checkout, so it needs dependencies and local configuration. Put the commands in `.cursor/worktrees.json` and Cursor runs them in each new worktree: ``` { "setup-worktree": [ "npm ci", "cp $ROOT_WORKTREE_PATH/.env .env" ] } ``` Use `setup-worktree-unix` and `setup-worktree-windows` when the commands differ by platform. The docs recommend a fast package manager over symlinking dependencies into the worktree. ## Cloud agents Cloud agents, formerly Background Agents, run in isolated VMs in the cloud. Each works on a separate branch and pushes its changes to your repository, and the docs say you can run as many as you want in parallel. Start one from the Cloud option under the agent input, from cursor.com/agents, or by commenting `@cursor` on a GitHub pull request or issue. See the [Cursor cloud agent docs](https://cursor.com/docs/cloud-agent). ## Local worktree or cloud agent | | Local worktree | Cloud agent | | --- | --- | --- | | Where it runs | On your machine, in a separate checkout | In an isolated VM in the cloud | | How work comes back | `/apply-worktree`, or a commit and pull request from the worktree | A separate branch pushed to your repository | | Good for | Tasks you want to compare or review locally | Tasks that run while your machine is busy or off | ## A workflow for several Cursor agents 1. Give each agent one task with a clear boundary, and start it in a worktree or as a cloud agent. 2. Use `/best-of-n` when you want to compare models on one task. It compares runs and merges nothing, so pick the result you want afterwards. 3. Review each result where it ran, then commit, push and open a pull request for it. 4. Remove finished worktrees with `/delete-worktree`, or let Cursor clean up the oldest. 5. Land the pull requests one at a time or through a merge queue, and update the remaining branches after each landing. ## Where the pull requests collide Whether an agent ran in a local worktree or a cloud VM, its branch started from one commit of main. Once another pull request lands, that branch is behind. Edits to the same lines become merge conflicts. Edits to related code, such as a renamed function and a new call to its old name, merge cleanly and break the build. The more agents you run at once, the more often a landing sends the others back for repair. ## Landing the pull requests Keep each agent’s pull request to one task, and run your required checks on the combined result, not only on each branch. Land the pull request that changes shared code first, such as a rename or a changed function signature. Then ask the agent on each remaining branch to bring it up to date: ``` Merge origin/main into this branch. Resolve any conflicts so that both changes survive. Then run the full test suite and fix anything that fails because main changed. Show me what you changed. ``` A merge queue in front of main tests queued pull requests together before they merge, which catches the clean merges that break the build. [GitHub’s merge queue](https://merget.ai/guides/github-merge-queue) removes a pull request that conflicts, so that fix still comes back to an agent. Using Claude Code or Codex as well? See the [Claude Code worktrees guide](https://merget.ai/guides/claude-code-worktrees-merge) and the [Codex worktrees guide](https://merget.ai/guides/codex-worktrees-merge). ## Questions ### How do I run a Cursor agent in a worktree? Use `/worktree ` in the editor, or start or move an agent into a worktree from the Agents Window. ### How do I bring worktree changes back into my checkout? Run `/apply-worktree`, or commit and push from the worktree and open a pull request. ### Do Cursor cloud agents open pull requests? Each cloud agent works on a separate branch and pushes it to your repository for handoff as a pull request. ## When the agents outrun the merges A handful of agent pull requests a day land fine by hand. Cloud agents make it easy to start far more than that, and then each landing sends several agents back to update their branches. [Merget](https://merget.ai/how-it-works) is a merge queue for GitHub that does those updates for you. It works from GitHub, so nothing changes in how you use Cursor: an agent is finished when its pull request is open, whether it ran in a local worktree or a cloud VM. Merget finds the pull requests that collide, including the ones Git merges cleanly, resolves the conflicts in the order the pull requests will land, checks each fix, and puts it on the original pull request. What it cannot resolve safely comes back to a person. It starts in Advisory mode, which reports which of your open pull requests collide and changes no code. Try Merget on one repository for free, or talk it through with us first. [Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ### Merging git worktrees from parallel Claude Code agents Claude Code’s --worktree flag gives each session its own checkout and branch. Set them up, land the branches, and stop them colliding at merge time. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-worktrees-merge) ### Claude Code agent teams: landing the pull requests Agent teams coordinate the work between Claude Code sessions, not the merge. Set a team up, avoid overwrites, and land what it produces. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-agent-teams-pull-requests) ### Codex worktrees: merging parallel agent branches Codex runs each chat in its own git worktree so parallel tasks do not interfere. Turn the worktrees into pull requests and land them together. Merget team · Nov 13, 2026 · 4 min read [Open](https://merget.ai/guides/codex-worktrees-merge) [All guides](https://merget.ai/guides) --- # GitHub merge queue: how it works and what happens on a conflict How GitHub’s merge queue orders and tests pull requests, how to enable it, what happens when a queued pull request conflicts, and the alternatives. Merget team · Nov 13, 2026 · 5 min read GitHub’s merge queue lines up approved pull requests, tests each one together with the changes ahead of it, and merges it when the required checks pass. If a queued pull request conflicts with the base branch or fails a required check, GitHub removes it from the queue, and the author fixes it and queues again. ## What a merge queue is for On a busy branch, a pull request can pass its checks and still break main, because it was tested against an older main. A merge queue closes that gap. It builds a temporary branch containing the target branch, the pull requests ahead in the queue and yours, runs your required checks on that combination, and merges only if they pass. ## How to enable merge queue on GitHub 1. In the repository settings, edit the branch protection rule or ruleset for the target branch. 2. Turn on Require merge queue, then choose the merge method and group settings. 3. Update CI to run on the `merge_group` event, so required checks report on the queue’s temporary branches. 4. On an approved pull request, select Merge when ready to add it to the queue. ``` on: pull_request: merge_group: ``` GitHub documents which plans and repository types include merge queue, so check that before you plan around it. See [managing a merge queue](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue). ## How the queue groups and tests pull requests The queue works in merge groups. Each group is a temporary branch, named with the `gh-readonly-queue/` prefix, that holds the target branch plus one or more queued pull requests in order. Your required checks run against that branch through the `merge_group` event. Settings on the rule control how many pull requests go into a group, how many groups build at once and how long the queue waits for checks. If a group passes, its pull requests merge. If it fails, GitHub removes the failing pull request and rebuilds the groups behind it. ## What happens when a queued pull request conflicts GitHub’s documentation is specific: if there are failed required status checks or conflicts with the base branch, the pull request is removed from the queue, and the pull request timeline shows why. The author merges or rebases onto the base branch, resolves the conflict, waits for checks and queues again. That works when conflicts are rare. With many pull requests in flight, each removal costs a rebase, a CI run and a wait, and the pull requests behind it are tested again. ## What merge queue does not do - It does not resolve merge conflicts. It detects them and removes the pull request. - It does not look at code relationships. A renamed function and a new call to its old name are caught only if your checks fail on the combination. - It does not write the fix. The author, or their coding agent, does. ## Merge queues and coding agents Coding agents multiply the pull requests open against a repository. A merge queue keeps main green at that volume, but each removal still sends work back: an agent session to rebase and resolve, a CI run to check it, and a developer to restart both. The more pull requests are in flight, the more of them conflict. See [what merge conflicts cost](https://merget.ai/guides/cost-of-merge-conflicts-ai-coding-agents). ## When GitHub’s merge queue is enough If your pull requests rarely conflict and your checks catch what matters, the native queue may be all you need. Look at an alternative when pull requests are removed from the queue often, when the same branches are rebased again and again, or when main breaks from changes that merged cleanly. ## Common problems - Checks never start on a queued pull request. The workflow is missing the `merge_group` trigger, so the required check is never reported and the pull request cannot merge. Add the trigger to every workflow that produces a required check. - A pull request left the queue and you do not know why. Open its timeline. GitHub records whether a required check failed on the queued combination or the branch conflicts with the base branch. - The queue is slow. Each queued pull request waits for the full set of required checks. Raise the build concurrency in the rule so more of them are built at the same time, and keep the required checks to the ones that have to gate a merge. - The same pull requests keep getting removed. They are conflicting with each other. Land the one that changes shared code first, update the rest once, then queue them again. ## Questions ### What is a merge queue in GitHub? A merge queue is a GitHub feature that lines up pull requests, tests each one with the changes ahead of it, and merges it when required checks pass, so main stays green on a busy branch. ### How do I enable merge queue on GitHub? Turn on Require merge queue in the branch protection rule or ruleset for the branch, and make sure CI runs on the `merge_group` event. ### Does GitHub merge queue resolve merge conflicts? No. A pull request that conflicts with the base branch is removed from the queue, and its author resolves the conflict and queues again. ### Why was my pull request removed from the merge queue? Usually because a required check failed on the queued combination or the pull request conflicts with the base branch. The pull request timeline shows the reason. ### What are some alternatives to GitHub’s merge queue? Mergify, Graphite, Trunk, Aviator and Merget. They differ most in what happens when a queued pull request conflicts, which the table below compares. ## Alternatives to GitHub merge queue The main difference between merge queues is what happens to a pull request that conflicts. Merget is ours, so read this table knowing that, and check each vendor’s documentation. | Feature | Merget | GitHub merge queue | Mergify | Graphite | Aviator | | --- | --- | --- | --- | --- | --- | | Resolves merge conflicts | Yes | No | Mechanical conflicts only, in Preview | No | No | | Finds conflicts Git merges cleanly | Yes | No | No | No | No | | Who fixes a conflict | The queue | The author | The author, unless it is mechanical | The author | The author | [Compare the alternatives in detail](https://merget.ai/github-merge-queue-alternatives), with links to each vendor’s documentation. ## Merget: a merge queue that resolves the conflict [Merget](https://merget.ai/how-it-works) runs its own queue on GitHub. It works with public and private repositories, for organizations and personal accounts, and needs no label, comment or enqueue command. It finds conflicts between open pull requests, including the ones Git merges cleanly, resolves them in queue order, and lands the result through your required checks and reviews. It starts in Advisory mode, which changes no source code. On a branch that also uses GitHub’s native merge queue, Merget still prepares pull requests and you merge through GitHub’s queue. To let Merget land work itself, remove GitHub’s merge queue rule from that branch. [Read the setup guide](https://merget.ai/docs). Try Merget on one repository for free, or talk it through with us first. [Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ### Merging git worktrees from parallel Claude Code agents Claude Code’s --worktree flag gives each session its own checkout and branch. Set them up, land the branches, and stop them colliding at merge time. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-worktrees-merge) ### Claude Code agent teams: landing the pull requests Agent teams coordinate the work between Claude Code sessions, not the merge. Set a team up, avoid overwrites, and land what it produces. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-agent-teams-pull-requests) ### Codex worktrees: merging parallel agent branches Codex runs each chat in its own git worktree so parallel tasks do not interfere. Turn the worktrees into pull requests and land them together. Merget team · Nov 13, 2026 · 4 min read [Open](https://merget.ai/guides/codex-worktrees-merge) [All guides](https://merget.ai/guides) --- # “This branch has conflicts that must be resolved”: what it means and how to fix it GitHub shows this when your pull request and its base branch changed the same lines. Clear it in a few minutes on GitHub or the command line, and see it less. Merget team · Nov 13, 2026 · 8 min read Your pull request and the branch it merges into both changed the same lines, and GitHub will not guess which version to keep. Nothing is broken. You choose the final version of those lines, commit it, and the merge button comes back. It usually takes a few minutes. ## Pick the fix for your situation | What you see | What to do | | --- | --- | | The Resolve conflicts button is clickable | Fix it on GitHub, in the web editor. | | Resolve conflicts is greyed out | Fix it on the command line. GitHub’s editor only handles simple line conflicts. | | The conflict is in a lockfile or a generated file | Do not edit it by hand. Regenerate it, as described under “Conflicts that are not ordinary lines”. | | You would rather not do it yourself | Hand it to a coding agent with the prompt further down. | ## What the conflict markers mean Git marks each conflict inside the file with three lines. When you merge main into your branch, a conflict looks like this: ``` <<<<<<< HEAD const timeout = 30; ======= const timeout = 45; >>>>>>> origin/main ``` The part above `=======` is your branch. The part below it is the base branch. Replace the whole block, markers included, with the code that should exist once both changes are in: one side, the other, or a mix of the two. Here both authors raised the same timeout, so the fix is to agree on one number, not to keep both lines. Read the code around the block before you choose. Picking a side without knowing why the other person changed it is how a resolved conflict turns into a bug. ## Fix it on GitHub 1. In the pull request, select Resolve conflicts, near the bottom of the page. 2. In each file, edit every marked block so that only the final code remains, and delete the three marker lines. 3. Select Mark as resolved, and repeat for each file in the list. 4. Select Commit merge. This merges the whole base branch into your pull request branch, not only the conflicted lines. If your branch is protected, GitHub asks you to create a new branch for the result. See [GitHub’s steps](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-on-github). ## Fix it on the command line Use this when Resolve conflicts is greyed out, or when you want to run the code before you commit. Replace `main` with your pull request’s base branch if it is a different one. ``` git fetch origin git switch my-branch git merge origin/main git status # conflicted files are under "Unmerged paths" ``` Open each file in that list and fix the marked blocks. Then tell Git each file is done, and finish the merge: ``` git add path/to/file.js # once for each file you fixed git commit --no-edit git push ``` If it goes wrong partway, `git merge --abort` puts your branch back to where it was before the merge, and you can start again. If the branch is not on your machine yet, `gh pr checkout 123` fetches it by pull request number with the GitHub CLI. ## If your team rebases A rebase replays your commits on top of the base branch one at a time, so it can stop for conflicts more than once. ``` git fetch origin git rebase origin/main # fix the marked blocks, then: git add path/to/file.js git rebase --continue # repeat until the rebase finishes git push --force-with-lease ``` Two things catch people out. First, the sides swap: during a rebase the top block, marked `HEAD`, is the base branch, and the bottom block is your commit. Second, a rebase rewrites your commits, so the push has to be forced. `--force-with-lease` refuses to push if someone else has pushed to the branch since you fetched it. `git rebase --abort` takes you back to where you started. ## Merge or rebase? Both bring your branch up to date with the base branch. Merging adds one merge commit and leaves your existing commits alone, so it is safe on a branch other people have pulled. Rebasing gives a straight history, but it rewrites your commits, so you resolve conflicts commit by commit and have to force-push. If your team has no rule, merge the base branch in: it is one round of conflicts and nothing is rewritten. ## Conflicts that are not ordinary lines - Lockfiles, such as `package-lock.json`, `yarn.lock` or `Cargo.lock`. Do not merge them by hand. Fix the conflict in the manifest first (`package.json`, `Cargo.toml`), take the base branch’s lockfile with `git checkout origin/main -- package-lock.json`, then run your install command so it adds your dependencies back. - A file that one side deleted. `git status` says “deleted by them” or “deleted by us”. Decide whether the file should still exist: `git rm path` accepts the deletion, and `git add path` keeps the file. If the other branch moved the code somewhere else, make your change in the new place. - Generated files, such as build output or test snapshots. Take either version, run the generator again, and commit what it produces. - Binary files, such as images. Git cannot combine them, so keep one whole version with `git checkout --ours path` or `git checkout --theirs path`, then `git add` it. In a merge, “ours” is your branch. In a rebase it is the base branch. ## Check before you push Make sure no markers are left behind. This prints nothing when the files are clean: ``` git grep -n -e '^<<<<<<<' -e '^>>>>>>>' ``` Then build the project and run the tests. A conflict is resolved when the code works, not when Git stops complaining. The two changes can still disagree in lines Git never marked. ## Have a coding agent do it Coding agents handle most conflicts well when you tell them to keep both changes and to prove the result. This prompt works in Claude Code, Codex and Cursor: ``` Merge origin/main into this branch and resolve the conflicts. For each conflict, read both sides and the commits that made them, and keep the intent of both changes. Do not just pick one side. Regenerate lockfiles instead of editing them. Then run the build and the tests. Show me each conflict and how you resolved it before you push. ``` Read what it shows you before you approve the push. On GitHub, Copilot can also propose a fix from the pull request when it is enabled for the repository. ## Why it came back after you fixed it You resolve a conflict against the base branch as it is at that moment. If another pull request lands before yours merges and touches the same lines, the message returns and you resolve it again. You did nothing wrong. It also explains why the message can appear on a pull request that was fine when you opened it. ## How to see it less - Keep pull requests small and merge them quickly. A branch that lives for an hour rarely conflicts. One that lives for a week usually does. - Update your branch from the base branch often, so conflicts arrive one at a time. - Turn on `git rerere` with `git config --global rerere.enabled true`. Git then remembers how you resolved a conflict and reuses that the next time the same conflict appears, which helps most with repeated rebases. - Show the original code inside conflicts with `git config --global merge.conflictStyle zdiff3` (use `diff3` on Git older than 2.35). A third block appears with what the lines looked like before either change, and the right answer is often obvious from it. - Split up files that everyone edits, such as route tables and shared config, or agree who owns them. - Use a merge queue, so pull requests are tested in the order they will land. Be aware that [GitHub’s merge queue](https://merget.ai/guides/github-merge-queue) removes a pull request that conflicts and hands it back to you. It does not resolve the conflict. ## A clean merge is not proof that it works This message only covers changes to the same lines. Two pull requests can change different files and still not work together: one renames a function while the other adds a call to its old name. GitHub shows no message, the merge is clean, and main breaks afterwards. Only a build or test run on the combined code catches that. See [why a clean merge can still break main](https://merget.ai/blog/why-a-clean-merge-can-still-break) for an example you can run. ## Questions ### What does “This branch has conflicts that must be resolved” mean? Your pull request and its base branch contain competing changes that Git cannot combine automatically. GitHub blocks the merge until you choose the final content. ### What do the <<<<<<<, ======= and >>>>>>> lines mean? They mark one conflict. In a merge, the lines between `<<<<<<<` and `=======` are your branch and the lines between `=======` and `>>>>>>>` are the base branch. In a rebase the two are the other way round. ### Why did the conflict appear after I opened the pull request? Another pull request merged into the base branch and changed the same lines. Your branch is now behind it. ### Can I resolve merge conflicts on GitHub without the command line? Yes, for simple line conflicts: use Resolve conflicts in the pull request. If the button is greyed out, the conflict needs the command line or another Git client. ### Does resolving the conflict on GitHub change my branch? Yes. GitHub merges the whole base branch into your pull request branch and adds a merge commit to it. ### How do I stop getting merge conflicts? Keep pull requests small, update your branch often and turn on `git rerere`. When many pull requests are open at once, a merge queue puts them in order. ## If you see this message every day An occasional conflict needs nothing more than the steps above. It becomes a different problem when the message is on most of your pull requests. That is common once several people, or several coding agents, open pull requests against the same branch all day: every merge moves the base branch and puts every other open pull request behind it. [Merget](https://merget.ai/how-it-works) is built for that case. It is a merge queue for GitHub that works out which open pull requests collide and in which order they should land. It then resolves the conflicts in that order, checks each fix, and puts the fix on the original pull request. It also finds the pull requests that merge cleanly and still break each other. What it cannot resolve safely comes back to a person. It starts in Advisory mode, which only reports the conflicts between your open pull requests and changes no code. You turn on resolving for a repository once you trust what it reports. Try Merget on one repository for free, or talk it through with us first. [Sign up free](https://sema.merget.ai/login) [Book a call](https://cal.com/ved-kulkarni-mz107m/merget-demo-call) ### Merging git worktrees from parallel Claude Code agents Claude Code’s --worktree flag gives each session its own checkout and branch. Set them up, land the branches, and stop them colliding at merge time. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-worktrees-merge) ### Claude Code agent teams: landing the pull requests Agent teams coordinate the work between Claude Code sessions, not the merge. Set a team up, avoid overwrites, and land what it produces. Merget team · Nov 13, 2026 · 5 min read [Open](https://merget.ai/guides/claude-code-agent-teams-pull-requests) ### Codex worktrees: merging parallel agent branches Codex runs each chat in its own git worktree so parallel tasks do not interfere. Turn the worktrees into pull requests and land them together. Merget team · Nov 13, 2026 · 4 min read [Open](https://merget.ai/guides/codex-worktrees-merge) [All guides](https://merget.ai/guides)