1

I really like Jupyter Notebooks. However, working with them is cumbersome in conjunction with a source control system like git, because an ipynb-File contains the source code (what you actually write in the notebook) and the generated output text / HTML / images / metadata / ...

For example, merge conflicts are difficult to resolve now, because everything is stored in one huge file with lots of generated data.

I wonder if I can configure Jupyter to store notebooks as

  • A source file: For example, I imagine this to be a Markdown file where everything surrounded by three backticks (```) is interpreted as a code cell. Diffs of that file would be meaningful and merge conflicts would be simple to resolve manually.
  • A generated file: This contains everything else. If there is a merge conflict within this file, it can be resolved by regenerating it.

Is this possible?

Georg
  • 960
  • 2
  • 7
  • 22

1 Answers1

0

For reference: There is a slightly more general version of this question which lists various efforts at adapting IPython and Jupyter to this effect, and this answer proposes to solve the problem via Git. There is a Github project with a Git filter based on that answer, and (in its edit at the end) the answer links a few similar tools like nbstripout.

Community
  • 1
  • 1
Hans
  • 2,419
  • 2
  • 30
  • 37