I'm using a strategy to filter ipynb notebooks described in the top answer here, with this in my .gitattributes
*.ipynb filter=strip-notebook-output
and this in my .git/config
[filter "strip-notebook-output"]
clean = """jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True --ClearMetadataPreprocessor.preserve_nb_metadata_mask=\"kernelspec\" --to=notebook --stdin --stdout --log-level=ERROR"""
It works well, except for the fact that if others clone my repo, they have to add the same lines to the .git/config.
My question is: is there a simple way to have this filter command automatically work when the repo is cloned?
Possibilities:
- automatically add to the
.git/config - somehow add the entire driver to the
.gitattributesfile - not quite as simple: use the nbstripout library instead of the one line command? (requires an install)
- use a template directory (as described here)--this seems unnecessarily difficult with a single line command