Hacker News new | ask | show | jobs
by tejtm 2898 days ago
Until there is a meaningful `git diff` for jupyter notebooks I can't see them being a step in the right direction for anything but transient experiments (and of course what Jypyter is great at; communication, documentation, low barriers etc.)
2 comments

This is effectively a solved problem, but it does require some tooling. Pre-commit hooks can strip things like execution count and/or outputs from the notebook: https://gist.github.com/minrk/6176788
See also: nbdime to diff / merge notebooks https://github.com/jupyter/nbdime
Thanks will give this a try
caveat: I haven't tested this particular one, it was just the first thing I found in a quick search.

This post has more detail on a faster approach using jq: http://timstaley.co.uk/posts/making-git-and-jupyter-notebook...

Something I always wondered about: why are Jupyter Notebooks JSON-Files and not directories where each cell and result has a coresponding single file? Would also make managing attatchments and versionscontrol per notebook quite easy.