Richard Richard - 1 month ago 30
Git Question

Should ipynb checkpoints be stored in git?

As the title says: I'm checking a Jupyter notebook into a github repo, should I store the ipynb checkpoints in github too, or are they best gitignored and kept locally?

I'm not really sure what they are for, so I don't know whether to include them or not.

Thanks for any help.

Answer

If you have no clue what they are ask yourself this:

Are they text or binary files?

If they are binary files they should not be stored in git.
If not (which is the case here) they can be added to git.


.ipynb

Notebook documents.

Notebook documents contains the inputs and outputs of a interactive session as well as additional text that accompanies the code but is not meant for execution.

In this way, notebook files can serve as a complete computational record of a session, interleaving executable code with explanatory text, mathematics, and rich representations of resulting objects.

These documents are internally JSON files and are saved with the .ipynb extension. Since JSON is a plain text format, they can be version-controlled and shared with colleagues.