MergeForge: Resolve Git Conflicts in VS Code or Cursor Like in JetBrains
MergeForge: Resolve Git Conflicts in VS Code or Cursor Like in JetBrains
MergeForge:像在 JetBrains 中一样在 VS Code 或 Cursor 中解决 Git 冲突
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. 厌倦了盯着 VS Code 堆叠式的合并编辑器了吗?MergeForge 为 VS Code 和 Cursor 带来了 JetBrains 风格的三窗格冲突解决工具,并配备了一个在建议修复方案前会真正阅读你代码库的 AI 助手。
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. 我们都经历过这种情况:变基(rebase)进行到一半,Git 停止了,十二个文件出现冲突。你在 VS Code 中打开其中一个……看到的还是那熟悉的堆叠布局:传入更改(Incoming)、当前更改(Current),以及一个感觉像是丢了一半拼图的“结果”窗格。
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. 如果你用过 WebStorm 或 IntelliJ,你就会知道优秀的合并工具体验有多好:左侧是你的代码,右侧是对方的代码,中间是结果,还有那些“即点即用”的侧边栏箭头。在 VS Code 的世界里,这种流程一直没能完美实现。你点击“接受当前”、“接受传入”或“全部接受”,然后祈祷没有重要的代码被覆盖。单词级的差异对比?作者信息?清晰的“这段代码是谁写的?”提示?这些在你最需要的时候往往缺失。
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. 当 AI 加入对话时,许多工具将冲突视为孤立的文本块:“这是 <<<<<<< 标记,祝你好运。”但真正的合并需要上下文。这个分支想要实现什么?周围的文件是什么样的?最后是谁修改了这里?没有这些信息,“AI 解决”不过是自信的猜测。
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. 我想要在 VS Code 和 Cursor 中获得 JetBrains 的合并体验,并拥有一个表现得像细心的队友而非老虎机一样的 AI 助手。所以我开发了它。
The solution: MergeForge
解决方案:MergeForge
MergeForge is an open-source VS Code / Cursor extension that turns conflicted files into a proper three-pane visual merge. MergeForge 是一个开源的 VS Code / Cursor 扩展,它将冲突文件转换为真正的三窗格可视化合并界面。
Layout:
- Left: Yours (local)
- Center: Result (editable, seeded from the merge base)
- Right: 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. 布局:
- 左侧: 你的代码(本地)
- 中间: 结果(可编辑,基于合并基准生成)
- 右侧: 对方的代码(传入)
- 窗格同步滚动。代码块通过连接带关联。侧边栏控件让你无需与 UI 搏斗即可接受、忽略或混合两侧代码。完成后,点击“应用”即可写入结果并将其暂存到 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). 如果你更喜欢 Cursor,也没问题。编辑器的工作方式相同;对于 AI 功能,你需要填入自己的提供商密钥(Cursor 不会向扩展公开其内置模型)。
Install it from the marketplace or Open VSX:
从市场或 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 Or search “MergeForge” in the Extensions view. 或者在扩展视图中搜索“MergeForge”。
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. JetBrains 风格的三窗格合并编辑器: 你的版本、可编辑的结果以及对方的版本——并排显示、同步滚动,支持 » / « 接受、× 忽略、连接带、单词级差异对比以及完整的 Cmd/Ctrl+Z 撤销功能。
- Handy extras: Apply All Non-Conflicting Changes (the wand) clears the easy stuff; Magic Resolve keeps both sides when both simply added lines; F7 / Shift+F7 to jump changes; Alt+← / Alt+→ to accept left/right. 便捷功能: “应用所有无冲突更改”(魔杖图标)可清理简单内容;“魔法解决”在双方仅添加行时保留双方内容;F7 / Shift+F7 跳转更改;Alt+← / Alt+→ 接受左侧/右侧更改。
- AI that reads your repo, not just the conflict markers: Explain conflicts, resolve them into the result pane, or Fix all. 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. 阅读代码库而非仅读取冲突标记的 AI: 解释冲突、将其解决到结果窗格,或“修复全部”。模型可以使用只读工具——打开文件、搜索代码、检查历史、查找符号——并且你可以看到实时的 ⚙ 活动,确保一切透明。
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.
- 开箱即用支持 VS Code 中的 GitHub Copilot(语言模型 API)。
- 或者使用你自己的 Anthropic、OpenAI、DeepSeek、Kimi/Moonshot 或任何兼容 OpenAI 的端点密钥。
Open source & contributions welcome
开源与贡献欢迎
MergeForge is MIT-licensed and fully open source. Repo: github.com/ognjenmarcheta/merge-forge MergeForge 采用 MIT 协议,完全开源。仓库地址: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. 如果它能为你节省哪怕一次痛苦的变基过程:
- ⭐ 给仓库点个星,让其他冲突受害者能找到它。
- 🐛 提交 Issue 反馈 Bug、奇怪的冲突形状或无障碍问题。
- 🔧 发送 PR——UI 优化、提供商支持、文档、评估测试用例……都欢迎贡献。