Merge conflicts are hard, and Jupyter Notebooks' JSON backend makes them inordinately worse. Alternatives like Marimo and converting back and forth through Jupytext have emerged over the years to sidestep the problem by moving away from .ipynb entirely.
MergeNB takes a different approach, much like nbdime. That is, instead of changing your notebook format, it gives you a web-based GUI purpose-built for resolving Jupyter Notebook merge conflicts cell-by-cell. I have plans to make MergeNB available across a variety of platforms, including as a plain git mergetool (like nbdime), hence the web is the easiest, most universal way to accomplish this.
- Side-by-side 2-way and 3-way diff view, with intra-cell conflict highlighting.
- JupyterLab's rendering engine which fully supports HTML, LaTeX, images, SVG plots, and other MIME types.
- CodeMirror syntax highlighting for Python, Scala, R, Julia, and other supported Jupyter kernels.
- Support for MacOS, Windows, and Linux!
- Configurable resolution rules and UI preferences.
- Full undo/redo history with a panel to jump to any prior resolver state.
- Cell matching across branches, even when cells move:
Fig. 2. The conflict resolver GUI when a cell is moved across branches
- Configurable auto-resolution for execution counts, kernel versions, outputs, and whitespace:
Fig. 3. MergeNB optionally removing noisy conflicts
-
Check out the Release page for the last stable version - MergeNB Releases - and install the
.vsixfile from there. -
Then, go to VSCode, look up "Extensions: Install from VSIX..." in the Command Palette, and select the downloaded file.
- Command:
MergeNB: Resolve Merge Conflicts - ID:
merge-nb.findConflicts - Also available from right clicking conflicted file and status bar if applicable.
Typical flow:
- Review each conflict row
- Choose
base,current,incoming, ordeleteper conflict - Optionally edit or delete the resolved source text
- Apply resolution and return to VS Code
MergeNB settings are split up into 3 main types
We optionally auto-resolve a few conflicts:
| Setting | Default | Effect |
|---|---|---|
mergeNB.autoResolve.executionCount |
true |
Sets conflicting execution_count to null instead of asking |
mergeNB.autoResolve.kernelVersion |
true |
Uses current branch's kernel and language_info.version |
mergeNB.autoResolve.stripOutputs |
true |
Clears cell outputs during merge |
mergeNB.autoResolve.whitespace |
true |
Drops trailing-whitespace and CRLF-only diffs silently |
UI preferences:
| Setting | Default | Effect |
|---|---|---|
mergeNB.ui.theme |
"dark" |
Resolver theme. "light" uses a beige palette sourced from the logo. |
mergeNB.ui.hideNonConflictOutputs |
false |
Hides outputs for rows without conflicts |
mergeNB.ui.showCellHeaders |
false |
Shows cell type, execution count, and cell index in row headers |
mergeNB.ui.showBaseColumn |
false |
Shows the base column in the 3-way view (defaults on in headless/test mode) |
mergeNB.ui.enableUndoRedoHotkeys |
true |
Enables Ctrl/Cmd+Z and Ctrl/Cmd+Shift+Z inside the resolver |
| Setting | Default | Effect |
|---|---|---|
mergeNB.security.trustContent |
true in trusted workspaces, false otherwise |
Trusts notebook-authored HTML, Markdown, and rich outputs only when Workspace Trust is enabled. Set to false to always use strict rendering. |


