Strip Jupyter notebook outputs from Git

Jupyter notebook outputs can be large (plots, images, etc.), making Git repo history excessively large and making Git operations slower as the Git history grows. Jupyter notebook outputs can reveal personal information with regard to usernames, Python executable, directory layout, and data outputs.

Strip all Jupyter outputs from Git tracking with a client-side Git pre-commit hook. We use Git pre-commit hook because Git filters can interfere with other programs such as CMake ExternalProject.

Tell Git user-wide where to find Git hooks:

git config --global core.hooksPath ~/.git/hooks

Edit the file ~/.git/hooks/pre-commit to contain: