<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Laksh Mishra</title>
    <description>The latest articles on DEV Community by Laksh Mishra (@laksh_mishra_d5d5ad23b0be).</description>
    <link>https://dev.to/laksh_mishra_d5d5ad23b0be</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3951795%2Faec8cc3e-592c-4f03-8420-12d8eca3094d.png</url>
      <title>DEV Community: Laksh Mishra</title>
      <link>https://dev.to/laksh_mishra_d5d5ad23b0be</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/laksh_mishra_d5d5ad23b0be"/>
    <language>en</language>
    <item>
      <title>I made git merge finish itself — in VS Code, in my terminal, and in CI</title>
      <dc:creator>Laksh Mishra</dc:creator>
      <pubDate>Tue, 26 May 2026 05:46:51 +0000</pubDate>
      <link>https://dev.to/laksh_mishra_d5d5ad23b0be/i-made-git-merge-finish-itself-in-vs-code-in-my-terminal-and-in-ci-3pf6</link>
      <guid>https://dev.to/laksh_mishra_d5d5ad23b0be/i-made-git-merge-finish-itself-in-vs-code-in-my-terminal-and-in-ci-3pf6</guid>
      <description>&lt;p&gt;Based on your Merge Magic draft , here’s a cleaner CEO-style Markdown version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Merge Magic: Resolving the Merge Conflicts That Shouldn’t Need a Human&lt;/span&gt;

I built &lt;span class="gs"&gt;**Merge Magic**&lt;/span&gt; because I got tired of resolving the same merge-conflict pattern over and over again.

Same conflict shape.  
Same “keep both” outcome.  
Same wasted time every time I rebased onto &lt;span class="sb"&gt;`main`&lt;/span&gt;.

At first, it was a small utility to remove that friction. Over a few weeks, it became something I now use daily.

Merge Magic automatically resolves merge conflicts that are clearly additive, while surfacing the ones that actually require human judgment.

It is free, bring-your-own-AI, and it never auto-commits.

You stay in control.
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;## What Merge Magic Does&lt;/span&gt;

Merge Magic is designed around a simple idea:
&lt;span class="gt"&gt;
&amp;gt; Most merge conflicts are not real disagreements.  &lt;/span&gt;
&lt;span class="gt"&gt;&amp;gt; They are just two useful changes landing in the same place.&lt;/span&gt;

For example:

&lt;span class="p"&gt;```&lt;/span&gt;&lt;span class="nl"&gt;js
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;HEAD&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[users] fetch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;=======&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id required&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;validation&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One branch added logging.&lt;br&gt;
Another added validation.&lt;/p&gt;

&lt;p&gt;The correct resolution is obvious: keep both.&lt;/p&gt;

&lt;p&gt;A developer can resolve this in 30 seconds. But multiplied across every rebase, every PR, and every team member, those 30 seconds become a tax.&lt;/p&gt;

&lt;p&gt;Merge Magic removes that tax where it can — and refuses to guess where it should not.&lt;/p&gt;


&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;Merge Magic resolves conflicts in three layers.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Mechanical Pre-Pass
&lt;/h3&gt;

&lt;p&gt;Some conflicts can be resolved safely from text alone.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identical edits on both sides&lt;/li&gt;
&lt;li&gt;One-sided edits where the other side matches the base&lt;/li&gt;
&lt;li&gt;Clearly additive changes in different parts of the same region&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These require no AI call.&lt;/p&gt;

&lt;p&gt;They are resolved instantly because the answer is structurally obvious.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. AI-Assisted Resolution
&lt;/h3&gt;

&lt;p&gt;For conflicts that need more context, Merge Magic dispatches the conflict to whichever AI tool you already use.&lt;/p&gt;

&lt;p&gt;Supported backends include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VS Code language model API&lt;/li&gt;
&lt;li&gt;Copilot&lt;/li&gt;
&lt;li&gt;Claude Code CLI&lt;/li&gt;
&lt;li&gt;Ollama&lt;/li&gt;
&lt;li&gt;Anthropic&lt;/li&gt;
&lt;li&gt;OpenAI&lt;/li&gt;
&lt;li&gt;Gemini&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no forced subscription layer.&lt;/p&gt;

&lt;p&gt;You bring the model. Merge Magic brings the workflow.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Verification Floor
&lt;/h3&gt;

&lt;p&gt;Every auto-resolved file is checked against build diagnostics.&lt;/p&gt;

&lt;p&gt;Merge Magic captures the baseline error set first, then checks the merged result.&lt;/p&gt;

&lt;p&gt;If the resolution introduces new errors, it reverts the file back to conflict markers and shows the actual diagnostic.&lt;/p&gt;

&lt;p&gt;Pre-existing errors do not cause false failures.&lt;/p&gt;

&lt;p&gt;This is the safety floor.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Line I Refused to Cross
&lt;/h2&gt;

&lt;p&gt;The most important design decision was not what Merge Magic resolves.&lt;/p&gt;

&lt;p&gt;It was what it refuses to resolve.&lt;/p&gt;

&lt;p&gt;When two branches genuinely disagree, Merge Magic does not guess.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Both branches rename a function differently&lt;/li&gt;
&lt;li&gt;One branch deletes code while another modifies it&lt;/li&gt;
&lt;li&gt;Both branches change the same constant to different values&lt;/li&gt;
&lt;li&gt;Two changes appear semantically incompatible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In those cases, Merge Magic opens a decision card with context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This conflict is between two commits:

🔴 HEAD        a1b2c3d   perf: bigger page size, shorter session timeout
                          Alice Chen · 2 days ago

🟢 MERGE_HEAD  9b79e0a   scale: max page size, longer session for enterprise
                          Bob Kumar · 1 day ago
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal is not to hide hard decisions.&lt;/p&gt;

&lt;p&gt;The goal is to make the easy ones disappear and make the hard ones clearer.&lt;/p&gt;




&lt;h2&gt;
  
  
  Three Surfaces, One Engine
&lt;/h2&gt;

&lt;p&gt;Merge Magic runs in three places.&lt;/p&gt;

&lt;h3&gt;
  
  
  VS Code
&lt;/h3&gt;

&lt;p&gt;A VS Code extension with an auto-mode dashboard.&lt;/p&gt;

&lt;p&gt;When &lt;code&gt;git merge&lt;/code&gt; produces conflicts, files resolve in parallel with a live progress view.&lt;/p&gt;

&lt;h3&gt;
  
  
  Terminal
&lt;/h3&gt;

&lt;p&gt;A CLI that can register as a global Git merge driver:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; merge-magic
mergemagic setup
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"* merge=mergemagic"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; .gitattributes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, &lt;code&gt;git merge&lt;/code&gt; and &lt;code&gt;git rebase&lt;/code&gt; can invoke the resolver inline.&lt;/p&gt;

&lt;p&gt;This is especially useful for recurring conflicts during rebase replay.&lt;/p&gt;

&lt;h3&gt;
  
  
  CI
&lt;/h3&gt;

&lt;p&gt;A GitHub Action can resolve PR conflicts server-side before a human review:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm install -g merge-magic&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.ANTHROPIC_API_KEY }}&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mergemagic ci --base "${{ github.base_ref }}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CI check posts a Markdown report to the Actions summary.&lt;/p&gt;

&lt;p&gt;If a conflict requires a real human decision, the check fails loudly.&lt;/p&gt;

&lt;p&gt;It does not silently pick a side.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Deliberately Do Not Claim
&lt;/h2&gt;

&lt;p&gt;A lot of AI developer tools overclaim.&lt;/p&gt;

&lt;p&gt;I tried hard not to.&lt;/p&gt;

&lt;h3&gt;
  
  
  It is not an AST merge
&lt;/h3&gt;

&lt;p&gt;The mechanical pre-pass is a careful three-way line merge.&lt;/p&gt;

&lt;p&gt;It is not tree-sitter.&lt;br&gt;
It is not structural merging.&lt;br&gt;
It is not a true AST-aware resolver.&lt;/p&gt;

&lt;p&gt;That is a harder problem, and it is still on the roadmap.&lt;/p&gt;
&lt;h3&gt;
  
  
  Semantic warnings are heuristics
&lt;/h3&gt;

&lt;p&gt;When the model says two changes may interact, that is not static analysis.&lt;/p&gt;

&lt;p&gt;It is a heuristic.&lt;/p&gt;

&lt;p&gt;Useful, but not authoritative.&lt;/p&gt;
&lt;h3&gt;
  
  
  The benchmark is not “better than Copilot”
&lt;/h3&gt;

&lt;p&gt;Copilot’s smart-action resolver is not scriptable, so a clean automated head-to-head benchmark is not really possible.&lt;/p&gt;

&lt;p&gt;Merge Magic’s benchmark reports match rate against known human resolutions on a corpus you provide.&lt;/p&gt;

&lt;p&gt;That is useful.&lt;/p&gt;

&lt;p&gt;It is also honest.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;The promise of AI in developer workflows should not be “trust the model blindly.”&lt;/p&gt;

&lt;p&gt;It should be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remove the repetitive work.&lt;br&gt;
Preserve human judgment where it matters.&lt;br&gt;
Make the review surface clearer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is the philosophy behind Merge Magic.&lt;/p&gt;

&lt;p&gt;It is not trying to replace code review.&lt;/p&gt;

&lt;p&gt;It is trying to remove the part of conflict resolution that developers already know is mechanical.&lt;/p&gt;


&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;
&lt;h3&gt;
  
  
  VS Code
&lt;/h3&gt;

&lt;p&gt;Search for &lt;strong&gt;Merge Magic&lt;/strong&gt; in the Extensions Marketplace.&lt;/p&gt;

&lt;p&gt;Or install it here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=laksh-mishra.merge-magic" rel="noopener noreferrer"&gt;Merge Magic on VS Code Marketplace&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Terminal
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; merge-magic
mergemagic demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The demo runs in a temporary repository and will not touch your code.&lt;/p&gt;


&lt;h2&gt;
  
  
  Feedback I’m Looking For
&lt;/h2&gt;

&lt;p&gt;I would especially value feedback on three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Does the verification floor catch enough?&lt;/strong&gt;&lt;br&gt;
It catches type and lint failures, but not behavioral regressions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Is the mechanical pre-pass too conservative?&lt;/strong&gt;&lt;br&gt;
It currently defers anything ambiguous, even when an LLM might handle it well.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Is the CI mode too aggressive or too cautious?&lt;/strong&gt;&lt;br&gt;
Auto-commit is opt-in, and Merge Magic refuses to push directly to &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The most useful feedback is where it gets the resolution wrong.&lt;/p&gt;

&lt;p&gt;Those cases are what improve the resolver, the prompt, and the pre-pass.&lt;/p&gt;



&lt;p&gt;Merge conflicts are not going away.&lt;/p&gt;

&lt;p&gt;But the boring ones should.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
