0

I have a shared git folder with part of the project developed on jupyter notebooks.

I do not want jupyter autosaved files (checkpoints) to be pushed/pulled with the rest of the project.

In the main project folder (where the .gitignore file is) I have the following folder created by Jupyter: .ipynb_checkpoints. Inside that folder there are a bunch of checkpoint files all of the form: somename-checkpoint.ipynb.

I tried to add the following to my .gitignore but none of these works.

/.ipynb_checkpoints
/*ipynb_checkpoints
*-checkpoint.ipynb

None of these worked and the files are still read and pulled/pushed.

CAPSLOCK
  • 6,243
  • 3
  • 33
  • 56
  • 3
    Once files have been added and committed, those particular files are no longer ignored no matter what your .gitignore rules say. New instances of those files would be ignored (e.g., another, different .ipynb_checkpoints directory somewhere else in your directory hierarchy). Maybe this is what's happening to you? – Wolf Apr 04 '19 at 12:25
  • Possibly. So if the folder/file has been pushed once then adding the folder/file to .gitignore will not make git ignore it and everytime it gets updated git will keep checking the folder/files for updates? – CAPSLOCK Apr 04 '19 at 12:28
  • 2
    @Gio Exactly. [Help page for gitignore](https://git-scm.com/docs/gitignore) states: `A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected;` – Alderath Apr 04 '19 at 12:31
  • Thanks, the linked question fixed it =) – CAPSLOCK Apr 04 '19 at 12:38

0 Answers0