-1

I have a project and there are lots files with the name .ipynb_checkpoints or __pycache__. How do I add those to the gitignore. I have copied and pasted the few below but want to know the proper way.

*.ipynb_checkpoints
*.ipynb_checkpoints/
*.ipynb_checkpoints/.
*.ipynb_checkpoints/*
*.__pycache__
*.__pycache__/*
*.__pycache__/
*.__pycache__/.
Deshwal
  • 3,436
  • 4
  • 35
  • 94

1 Answers1

2

The __pycache__ folders (directories) that Python uses to store byte-compiled Python code into are most easily ignored with a single line reading:

__pycache__/

The trailing slash is optional. Note that there is no dot . character here.

The .ipynb_checkpoints folder that Jypter uses can be ignored the same way: just list its name with an optional trailing slash. See also Should ipynb checkpoints be stored in Git? and How to git ignore ipython notebook checkpoints anywhere in repository.

torek
  • 448,244
  • 59
  • 642
  • 775