I would like to version control Jupyter Notebooks using Git. Unfortunately, by default, Git and Jupyter
have you tried just straight up committing the notebooks. I saw similar posts to you when looking on version controlling jupyter notebooks, but when i just tried it it seemed to work fine.
example notebook on github
https://github.com/loegare/Test-Post-Please-Ignore/blob/master/Untitled%20Folder/Data%20Due%20Dilligence.ipynb
If you carefully read the documentation of gitattributes (where the textconv
config option is described) you will notice that the converter program must send the output to standard output:
...
Performing text diffs of binary files
Sometimes it is desirable to see the diff of a text-converted version of some binary files. For example, a word processor document can be converted to an ASCII text representation, and the diff of the text shown. Even though this conversion loses some information, the resulting diff is useful for human viewing (but cannot be applied directly).
The
textconv
config option is used to define a program for performing such a conversion. The program should take a single argument, the name of a file to convert, and produce the resulting text on stdout....
Therefore you must add the --stdout
option to your conversion command:
ipynb2py
#!/bin/bash
jupyter nbconvert --to python --stdout "$1"