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.
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
| Pattern | What 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.py | IPython 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
- To avoid committing notebook output, install
nbstripoutas a git filter, or make clearing output before committing a habit. - This template does not block large data files (
data/,*.csv,*.parquet). Add them yourself if needed, or use DVC or Git LFS. - If you keep API keys in
.envand read them from notebooks, you also need the.envrule from the Python template.
Original template
JupyterNotebooks.gitignore
# 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