{"slug": "i-made-git-merge-finish-itself-in-vs-code-in-my-terminal-and-in-ci", "title": "I made git merge finish itself — in VS Code, in my terminal, and in CI", "summary": "A developer built Merge Magic, an open-source tool that automatically resolves additive merge conflicts in VS Code, the terminal, and CI pipelines. The tool uses a three-layer approach—text-based resolution, optional AI dispatch, and build diagnostic verification—to handle conflicts where both branches add useful changes, while surfacing genuine disagreements for human judgment. Merge Magic is free, bring-your-own-AI, and never auto-commits, keeping developers in control.", "body_md": "Based on your Merge Magic draft , here’s a cleaner CEO-style Markdown version:\n\n```\n# Merge Magic: Resolving the Merge Conflicts That Shouldn’t Need a Human\n\nI built **Merge Magic** because I got tired of resolving the same merge-conflict pattern over and over again.\n\nSame conflict shape.  \nSame “keep both” outcome.  \nSame wasted time every time I rebased onto `main`.\n\nAt first, it was a small utility to remove that friction. Over a few weeks, it became something I now use daily.\n\nMerge Magic automatically resolves merge conflicts that are clearly additive, while surfacing the ones that actually require human judgment.\n\nIt is free, bring-your-own-AI, and it never auto-commits.\n\nYou stay in control.\n\n---\n\n## What Merge Magic Does\n\nMerge Magic is designed around a simple idea:\n\n> Most merge conflicts are not real disagreements.  \n> They are just two useful changes landing in the same place.\n\nFor example:\n\n``` js\n<<<<<<< HEAD\nexport function getUser(id) {\n  console.log('[users] fetch', id);\n  return db.users.findById(id);\n}\n=======\nexport function getUser(id) {\n  if (!id) throw new Error('id required');\n  return db.users.findById(id);\n}\n>>>>>>> feature/validation\n```\n\nOne branch added logging.\n\nAnother added validation.\n\nThe correct resolution is obvious: keep both.\n\nA developer can resolve this in 30 seconds. But multiplied across every rebase, every PR, and every team member, those 30 seconds become a tax.\n\nMerge Magic removes that tax where it can — and refuses to guess where it should not.\n\nMerge Magic resolves conflicts in three layers.\n\nSome conflicts can be resolved safely from text alone.\n\nExamples include:\n\nThese require no AI call.\n\nThey are resolved instantly because the answer is structurally obvious.\n\nFor conflicts that need more context, Merge Magic dispatches the conflict to whichever AI tool you already use.\n\nSupported backends include:\n\nThere is no forced subscription layer.\n\nYou bring the model. Merge Magic brings the workflow.\n\nEvery auto-resolved file is checked against build diagnostics.\n\nMerge Magic captures the baseline error set first, then checks the merged result.\n\nIf the resolution introduces new errors, it reverts the file back to conflict markers and shows the actual diagnostic.\n\nPre-existing errors do not cause false failures.\n\nThis is the safety floor.\n\nThe most important design decision was not what Merge Magic resolves.\n\nIt was what it refuses to resolve.\n\nWhen two branches genuinely disagree, Merge Magic does not guess.\n\nFor example:\n\nIn those cases, Merge Magic opens a decision card with context:\n\n```\nThis conflict is between two commits:\n\n🔴 HEAD        a1b2c3d   perf: bigger page size, shorter session timeout\n                          Alice Chen · 2 days ago\n\n🟢 MERGE_HEAD  9b79e0a   scale: max page size, longer session for enterprise\n                          Bob Kumar · 1 day ago\n```\n\nThe goal is not to hide hard decisions.\n\nThe goal is to make the easy ones disappear and make the hard ones clearer.\n\nMerge Magic runs in three places.\n\nA VS Code extension with an auto-mode dashboard.\n\nWhen `git merge`\n\nproduces conflicts, files resolve in parallel with a live progress view.\n\nA CLI that can register as a global Git merge driver:\n\n```\nnpm install -g merge-magic\nmergemagic setup\necho \"* merge=mergemagic\" >> .gitattributes\n```\n\nAfter that, `git merge`\n\nand `git rebase`\n\ncan invoke the resolver inline.\n\nThis is especially useful for recurring conflicts during rebase replay.\n\nA GitHub Action can resolve PR conflicts server-side before a human review:\n\n```\n- run: npm install -g merge-magic\n\n- env:\n    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n  run: mergemagic ci --base \"${{ github.base_ref }}\"\n```\n\nThe CI check posts a Markdown report to the Actions summary.\n\nIf a conflict requires a real human decision, the check fails loudly.\n\nIt does not silently pick a side.\n\nA lot of AI developer tools overclaim.\n\nI tried hard not to.\n\nThe mechanical pre-pass is a careful three-way line merge.\n\nIt is not tree-sitter.\n\nIt is not structural merging.\n\nIt is not a true AST-aware resolver.\n\nThat is a harder problem, and it is still on the roadmap.\n\nWhen the model says two changes may interact, that is not static analysis.\n\nIt is a heuristic.\n\nUseful, but not authoritative.\n\nCopilot’s smart-action resolver is not scriptable, so a clean automated head-to-head benchmark is not really possible.\n\nMerge Magic’s benchmark reports match rate against known human resolutions on a corpus you provide.\n\nThat is useful.\n\nIt is also honest.\n\nThe promise of AI in developer workflows should not be “trust the model blindly.”\n\nIt should be:\n\nRemove the repetitive work.\n\nPreserve human judgment where it matters.\n\nMake the review surface clearer.\n\nThat is the philosophy behind Merge Magic.\n\nIt is not trying to replace code review.\n\nIt is trying to remove the part of conflict resolution that developers already know is mechanical.\n\nSearch for **Merge Magic** in the Extensions Marketplace.\n\nOr install it here:\n\n[Merge Magic on VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=laksh-mishra.merge-magic)\n\n```\nnpm install -g merge-magic\nmergemagic demo\n```\n\nThe demo runs in a temporary repository and will not touch your code.\n\nI would especially value feedback on three things:\n\n**Does the verification floor catch enough?**\n\nIt catches type and lint failures, but not behavioral regressions.\n\n**Is the mechanical pre-pass too conservative?**\n\nIt currently defers anything ambiguous, even when an LLM might handle it well.\n\n**Is the CI mode too aggressive or too cautious?**\n\nAuto-commit is opt-in, and Merge Magic refuses to push directly to `main`\n\n.\n\nThe most useful feedback is where it gets the resolution wrong.\n\nThose cases are what improve the resolver, the prompt, and the pre-pass.\n\nMerge conflicts are not going away.\n\nBut the boring ones should.", "url": "https://wpnews.pro/news/i-made-git-merge-finish-itself-in-vs-code-in-my-terminal-and-in-ci", "canonical_source": "https://dev.to/laksh_mishra_d5d5ad23b0be/i-made-git-merge-finish-itself-in-vs-code-in-my-terminal-and-in-ci-3pf6", "published_at": "2026-05-26 05:46:51+00:00", "updated_at": "2026-05-26 06:04:22.854728+00:00", "lang": "en", "topics": ["ai-tools", "ai-products", "ai-startups", "ai-research", "mlops"], "entities": ["Merge Magic", "VS Code"], "alternates": {"html": "https://wpnews.pro/news/i-made-git-merge-finish-itself-in-vs-code-in-my-terminal-and-in-ci", "markdown": "https://wpnews.pro/news/i-made-git-merge-finish-itself-in-vs-code-in-my-terminal-and-in-ci.md", "text": "https://wpnews.pro/news/i-made-git-merge-finish-itself-in-vs-code-in-my-terminal-and-in-ci.txt", "jsonld": "https://wpnews.pro/news/i-made-git-merge-finish-itself-in-vs-code-in-my-terminal-and-in-ci.jsonld"}}