120

As the title says: I'm checking a Jupyter notebook into a GitHub repo, should I store the .ipynb_checkpoints folder 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.

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
Richard
  • 62,943
  • 126
  • 334
  • 542
  • 7
    I normally gitignore them, but you could go either way. The checkpoints are only updated on a manual save, whereas the main copy of the file is updated both on manual saves and on autosaves. The idea is that if you accidentally delete something just before it autosaves, you have the checkpoint to go back to. – Thomas K Mar 30 '16 at 15:05
  • Related: [What are Jupyter Notebook checkpoint files for?](https://stackoverflow.com/a/46422176/1709587) – Mark Amery May 24 '19 at 14:35

1 Answers1

169

The checkpoints are similar files as the original notebooks but are only updated on a manual save. The original notebooks are updated with autosave and when manually saving (thanks @Thomas K).

The question to you is if you want to share your manual saves with your collaborators. I prefer not to share those because git already provides the functionality to go back to an older version.

Also, I use https://www.gitignore.io/ to create .gitignore files and according to them the checkpoints are temporary data.

Pieter
  • 3,262
  • 1
  • 17
  • 27