News for hackers. Stuff that matters.
Re:Literate Programming: Empower Your Writing with Emacs Org... by sasvari on Sunday July 08, 2018 @03:09PM (#17485526)
You can use a filter in your gitconfig to strip away the outputs, and thus make it play nicer with git [0].

gitconfig:

  [filter "nbstrip_full"]
      clean = "jq --indent 1 \
              '(.cells[] | select(has(\"outputs\")) | .outputs) = []  \
              | (.cells[] | select(has(\"execution_count\")) | .execution_count) = null  \
              | .metadata = {\"language_info\": {\"name\": \"python\", \"pygments_lexer\": \"ipython3\"}} \
              | .cells[].metadata = {} \
              '"
      smudge = cat
      required = true

gitattributes:

  *.ipynb filter=nbstrip_full

[0] http://timstaley.co.uk/posts/making-git-and-jupyter-notebook...

There are no comments on this comment yet.