ipynb 检查点是否应该存储在 Git 中?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36306017/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:54:02  来源:igfitidea点击:

Should ipynb checkpoints be stored in Git?

gitjupyter-notebook

提问by Richard

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

正如标题所说:我正在将 Jupyter 笔记本检查到 GitHub 存储库中,我应该将该.ipynb_checkpoints文件夹也存储在 GitHub 中,还是最好将它们.gitignore保存在本地?

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

我不太确定它们的用途,所以我不知道是否包括它们。

回答by Pieter

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).

检查点是与原始笔记本类似的文件,但仅在手动保存时更新。原始笔记本通过自动保存和手动保存更新(感谢@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.

您的问题是您是否想与合作者共享您的手动保存。我不想分享这些,因为 git 已经提供了返回旧版本的功能。

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

另外,我使用https://www.gitignore.io/创建.gitignore文件,根据它们检查点是临时数据。