Skip to content

Instantly share code, notes, and snippets.

@parsingphase
Created March 18, 2025 15:33
Show Gist options
  • Save parsingphase/3c594df205fb024473613124bb3eee51 to your computer and use it in GitHub Desktop.
Save parsingphase/3c594df205fb024473613124bb3eee51 to your computer and use it in GitHub Desktop.

Keep volatile metadata and output stanzas out of .ipynb files in git:

.git/config contains

[filter "remove-notebook-output"]
    clean = "jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR"

.git/info/attributes contains

*.ipynb filter=remove-notebook-output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment