close

DEV Community

Ognjen Marčeta
Ognjen Marčeta

Posted on

MergeForge: Resolve Git Conflicts in VS Code or Cursor Like in JetBrains

Tired of squinting at VS Code’s stacked merge editor?

MergeForge brings a JetBrains-style three-pane conflict resolver to VS Code and Cursor — and pairs it with an AI assistant that actually reads your repository before it suggests a fix.

The problem

We’ve all been there.

You’re halfway through a rebase. Git stops. Twelve files are conflicted. You open one in VS Code… and get that familiar stacked layout: Incoming, Current, and a result pane that somehow still feels like a puzzle with half the pieces missing.

If you ever used WebStorm or IntelliJ, you know how good merge tools can feel:

  • Your side on the left
  • Their side on the right
  • The result in the middle
  • Gutter arrows that just… work

In VS Code land, that flow never quite arrived. You click Accept Current, Accept Incoming, Accept Both, and hope nothing important got flattened. Word-level diffs? Authorship? A clear “who wrote this chunk?” signal? Often missing when you need them most.

And when AI entered the chat, a lot of tools treated conflicts like isolated text blobs:

“Here are the <<<<<<< markers. Good luck.”

But real merges need context. What was the branch trying to do? What does the surrounding file look like? Who touched this last? Without that, “AI resolve” is just confident guessing.

I wanted the JetBrains merge experience — inside VS Code and Cursor — with an assistant that behaves more like a careful teammate than a slot machine.

So I built it.

The solution: MergeForge

MergeForge is an open-source VS Code / Cursor extension that turns conflicted files into a proper three-pane visual merge.

Layout:

Left Center Right
Yours (local) Result (editable, seeded from the merge base) Theirs (incoming)

Panes scroll together. Chunks connect with bands. Gutter controls let you accept, ignore, or blend sides without fighting the UI. When you’re done, Apply writes the result and stages it with git.

If you prefer Cursor, you’re covered too. The editor works the same; for AI features you plug in your own provider key (Cursor doesn’t expose its built-in models to extensions).

Install it from the marketplace or Open VSX:

# VS Code Marketplace
# https://marketplace.visualstudio.com/items?itemName=byte-forge.merge-forge

# Open VSX (Cursor / VSCodium-friendly)
# https://open-vsx.org/extension/byte-forge/merge-forge
Enter fullscreen mode Exit fullscreen mode

Or search “MergeForge” in the Extensions view.

Then, on a conflicted file:

  1. Use the editor title button, or Resolve in Merge Forge above a conflict
  2. Right-click in Explorer / Source Control
  3. Or run Merge Forge: Resolve Conflicts in File… from the Command Palette

Key features

JetBrains-style three-pane merge editor

Your version, the editable result, and theirs — side by side, scroll-synced, with » / « accept, × ignore, connector bands, word-level diffs, and full Cmd/Ctrl+Z undo.

Handy extras:

  • Apply All Non-Conflicting Changes (the wand) clears the easy stuff so you only decide the real conflicts
  • Magic Resolve keeps both sides when both simply added lines — and refuses to guess on genuine rewrites
  • F7 / Shift+F7 to jump changes; Alt+← / Alt+→ to accept left/right of the current chunk
  • Line endings, BOMs, and trailing newlines round-trip cleanly; binaries and huge files get honest “nope” messages instead of broken panes

AI that reads your repo, not just the conflict markers

Explain conflicts, resolve them into the result pane, or Fix all (safe mechanical merges first, model only on the red chunks). The model can use read-only tools — open files, search code, inspect history, look up symbols — and you see live activity so nothing is a black box.

Works with:

  • GitHub Copilot in VS Code (Language Model API) out of the box
  • Or your own key for Anthropic, OpenAI, DeepSeek, Kimi/Moonshot, or any OpenAI-compatible endpoint (OpenRouter, local Ollama, proxies)

Keys live in VS Code secret storage. Nothing hits git until you hit Apply. Unhappy with an AI edit? Undo that chunk like any other change.

Authorship chips, history timeline, and a real merge workflow

Every conflict side can show who last shaped it (GitHub avatars when available, offline-safe initials otherwise). Flip to a two-lane history timeline of the commits that produced the merge. Around the editor: a Conflicts dialog with progress, status-bar merge cluster, next-file loop after Apply, crash-safety snapshots, and correct left/right mapping during rebases and cherry-picks.

Built with care (and tests)

MergeForge is TypeScript end to end:

  • VS Code Extension API for commands, SCM, secret storage, and Copilot LM integration
  • Monaco Editor inside the webview for the three panes
  • node-diff3 + a custom chunking engine checked against real git merge-file output
  • Vercel AI SDK for multi-provider streaming and tool use
  • esbuild for the extension + webview bundles
  • Vitest for unit, git-parity, and end-to-end tests

The correctness bar matters: where git merges cleanly, MergeForge aims to match git byte for byte. There’s also a replay eval for the AI pipeline so prompt changes can be regression-checked against real historical merges.

git clone https://github.com/ognjenmarcheta/merge-forge.git
cd merge-forge
pnpm install
pnpm test
pnpm run watch   # then F5 to launch the Extension Development Host
Enter fullscreen mode Exit fullscreen mode

Open source & contributions welcome

MergeForge is MIT-licensed and fully open source.

Repo: github.com/ognjenmarcheta/merge-forge

If it saves you even one painful rebase:

  • Star the repo so other conflict survivors can find it
  • 🐛 Open an issue for bugs, weird conflict shapes, or accessibility gaps
  • 🔧 Send a PR — UI polish, provider support, docs, eval fixtures… all fair game

First-time contributors: the README has a harness (dev/harness.html) so you can poke the UI in a browser without launching a full extension host. There’s also a script that spins up throwaway conflicted repos for every conflict shape.

node scripts/make-conflict-repo.mjs
node scripts/make-conflict-repo.mjs --rebase
Enter fullscreen mode Exit fullscreen mode

Try it

Link For
VS Code Marketplace VS Code
Open VSX Cursor, VSCodium
GitHub Source, issues, stars

Next time git yells CONFLICT (content), open the file and forge the branches back into one piece.

Your turn

What’s the worst merge conflict you’ve ever had to untangle — and what should MergeForge add next: better multi-file orchestration, more keyboard power-user flows, or deeper AI “why did this conflict?” narratives?

Drop a comment. I read them all.

Top comments (0)