Jupytext will convert Notebooks (.ipynb) files to Markdown (md) and Python (py) 'on the fly' (while working in Notebooks).
- Markdown files can be added to git
- Python and .ipynb files are added to .gitignore
- Python files allow 'chained' import of notebooks (*.py verions), which allows to split larger notebooks into multiple smaller ones
This is my folder structure: .
├── notebooks
| ├── notebook1.ipynb # automatically generated from md
| └── notebook2.ipynb # automatically generated from md
├── md
| ├── notebook1.md # versioned in git
| └── notebook2.md # versioned in git
├── py
| ├──modules
| | ├──__init__.py # empty
| | └──tools.py # use for cross-project base tools
| ├──__init__.py # empty
| ├── notebook1.py # automatically generated from md
| └── notebook2.py # automatically generated from md
├──jupytext.toml
├──.git
└── README.md
See an example here [2]
Jupytext is mentioned as a 'potential' alternative. Re the "save" cell output: I usually produce html-files at the end of my notebooks (see the example), and add those either to git or auto-upload to an external webserver. The html is standalone and includes outputs, table of contents, and images (example [3]). I would advice against versioning all outputs (images) in git.
Very happy with this approach for a long time now. Jupytext increased my productivity by a hundred percent.
[1]: https://github.com/mwouts/jupytext
[2]: https://gitlab.vgiscience.de/ad/yfcc_gridagg
[3]: https://ad.vgiscience.org/tagmaps-mapnik-jupyter/01_mapnik-t...