SOLVED - Have vscode-jupyter do proper diffing in Git #10742
-
When trying to use git versioning with Jupyter notebooks, you end up with heugh diffs because Jupyter uses a structured format, JSON, instead of plain text. So Git will do a binary "diff" instead. One solution is to use GitHub - jupyter / nbdime along with git, but it would be so much easier if nbdime was part of the vscode-jupyter distribution. Then I wouldn't have to remember to set up nbdime when installing the Jupyter extension for vscode (git would of course be a prerequisite). As explained at the nbdime Open Source project site: nbdime provides “content-aware” diffing and merging of Jupyter notebooks. It understands the structure of notebook documents. Therefore, it can make intelligent decisions when diffing and merging notebooks, such as:
nbdime yields diffs like this: vscode-jupyter already pulls additional exentsions on setup, such as Jupyter Keymap and Jupyter Notebook Renderers and of course .Net Interactive Notebooks... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Currently VS Code has a great diffing tool for Jupyter Notebooks, we don't just diff the JSON file, see here |
Beta Was this translation helpful? Give feedback.
-
How to use the diffing tool as a merge tool? |
Beta Was this translation helpful? Give feedback.
Currently VS Code has a great diffing tool for Jupyter Notebooks, we don't just diff the JSON file, see here
https://code.visualstudio.com/docs/datascience/jupyter-notebooks#_custom-notebook-diffing
Please try this if you haven't, and let us know what's missing or needs to be improved here.