Skip to content

.ipynb version control and code review

cgpu edited this page May 13, 2020 · 2 revisions

Two strategies for facilitating .ipynb format code review and version control

Convert to a simple text file format with jupytext

jupytext --to R r_kernel.ipynb
jupytext --to Rmd r_kernel.ipynb

jupytext --to py python_kernel.ipynb

Use nbdiff for reviewing changes locally

For humane ipynb git diffs you can type:

nbdiff --ignore-details --ignore-outputs --ignore-metadata my_code.ipynb 
# or with shortcuts:
nbdiff -D -M -O  my_code.ipynb