github/gitignore · community/Python/JupyterNotebooks.gitignore

Jupyter Notebooks .gitignore Template Explained

Why JupyterNotebooks.gitignore ignores .ipynb_checkpoints, IPython profiles and .virtual_documents, and how to manage notebook output.

Open in generator Open with Python, macOS, VisualStudioCode

JupyterNotebooks.gitignore is a short template in the community folder of the template repository that deals only with files Jupyter and IPython create next to notebooks. It has no rules for virtual environments or __pycache__, so use it together with the Python template.

Execution results and images stored inside notebook files (.ipynb) are not something gitignore handles. The problem is the contents of the file, not the file itself, so it needs a separate tool.

Rules explained

PatternWhat it ignores and why
.ipynb_checkpoints*/.ipynb_checkpoints/*CheckpointsCopies Jupyter creates in every folder containing a notebook when it autosaves. The first line catches checkpoint folders at any depth, and the second explicitly catches the contents of such a folder one level down.
profile_default/ipython_config.pyIPython settingsThe IPython profile folder and config file, which can contain personal information such as the history database.
.virtual_documents/JupyterLab LSPThe virtual documents folder that the jupyterlab-lsp extension creates to pass notebooks to the language server.

Practical notes

Original template

JupyterNotebooks.gitignore5 rules
# gitignore template for Jupyter Notebooks# website: http://jupyter.org/.ipynb_checkpoints*/.ipynb_checkpoints/*# IPythonprofile_default/ipython_config.py# Jupyter lab virtual documents# https://jupyterlab-lsp.readthedocs.io/en/2.x/Configuring.html#virtual_documents_dir.virtual_documents/# Remove previous ipynb_checkpoints#   git rm -r .ipynb_checkpoints/

Templates from github/gitignore/community/Python/JupyterNotebooks.gitignore @356fd7b (2026-09-11) · CC0-1.0

Often used together