Skip to content

Instantly share code, notes, and snippets.

@pcolazurdo
Last active August 27, 2020 16:17
Show Gist options
  • Save pcolazurdo/745f4333143498a9d9356c3b31858c00 to your computer and use it in GitHub Desktop.
Save pcolazurdo/745f4333143498a9d9356c3b31858c00 to your computer and use it in GitHub Desktop.
Snippet to add a filter action to git to upload a clean notebook (no outputs) to the repo
echo '[filter "strip-notebook-output"]' >>.git/config
echo ' clean = "jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR"' >>.git/config
echo \*.ipynb filter=strip-notebook-output >.gitattributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment