ipynb_filter.py
: using nbconvert
to remove the a notebook's output on each commit to not clutter up your Git history.
+
No external dependencies, if you haveJupyter notebook
installed you will havenbconvert
-
A bit slow, ~150 ms-
need to make sure that every contributor uses it (otherwise it will result in conflicts)
Run wget https://raw.githubusercontent.com/basnijholt/ipynb_git_filters/master/ipynb_filter.py && echo "*.ipynb filter=ipynb_filter" >> .gitattributes && python ipynb_filter.py
- Copy
ipynb_filter.py
into your project root - Add the following line to your
.gitattributes
:*.ipynb filter=ipynb_filter
- run
python ipynb_filter.py