Use nbdime! 🙌
This setup worked for me and I use a separate env to keep my other envs clean.
conda env create --file environment-nbdime.yml
source activate nbdime
nbdime config-git --enable --global
edit ~/.gitconfig and change diff to webdiff as follows:
[diff "jupyternotebook"]
command = git-nbdiffdriver webdiff
- compare jupyter notebook file with local changes
git diff file.ipynb
- compare different jupyter notebooks
nbdiff-web file1.ipynb file2.ipynb
source activate nbdime; git diff *.ipynb
- http://timstaley.co.uk/posts/making-git-and-jupyter-notebooks-play-nice/ Not fond of these methods, I've tried them and no... I often clean all outputs and save a clean notebook. The manual save doesn't kill me, it's the diffs hence nbdime is a win for me