This is effectively a solved problem, but it does require some tooling.
Pre-commit hooks can strip things like execution count and/or outputs from the notebook: https://gist.github.com/minrk/6176788
This post has more detail on a faster approach using jq: http://timstaley.co.uk/posts/making-git-and-jupyter-notebook...