How do I view Jupyter Notebook git diffs in Visual Studio Code?

Viewed 811

How do I view Jupyter Notebook git diffs in Visual Studio Code?

Some sources seem to suggest this feature is available now, but I only see the diff of the raw file. https://code.visualstudio.com/updates/v1_49#_notebooks

I'm using the latest Visual Studio Code version, 1.62.3. I'm using the Python extension and "native notebooks". I'm not sure whether adding notebook.diff.enablePreview: true to settings.json is necessary, but in any case, it has no effect.

Update: I can see the readable diff when I select "Show Changes" on the notebook in the Source Control sidebar. The problem arises when I select "Click to View Diff" on a notebook at a specific commit in Git Graph. Perhaps it's a Git Graph problem -- what's the best workaround?

enter image description here

2 Answers

In the link you provided, the feature is controlled by setting notebook.diff.enablePreview to true

It works well on my computer, and it looks different from yours, how do you compare them? Could you attach a screenshot of the sidebar?

enter image description here enter image description here

Related