Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

19
  • 2
    How do you deal with the issue of incorporating changes that you pull? Do you just live with having to regenerate all of the output? (I think this is a manifestation of your second limitation.)
    – mforbes
    Commented Jan 1, 2014 at 20:14
  • 1
    @zhermes: this extended version should be OK Commented Apr 24, 2015 at 8:56
  • 1
    Is there a way to use this git filters method with an external diff tool? The filter is applied if I use the normal command line tool but not if I'm using meld as a diff tool. stackoverflow.com/q/30329615/578770
    – F-A
    Commented May 20, 2015 at 9:54
  • 1
    To avoid getting ImportError I had alter to the above to run using ipython: git config --global filter.dropoutput_ipynb.clean ipython ~/bin/ipynb_output_filter.py
    – chris838
    Commented Sep 12, 2015 at 17:55
  • 1
    Awsome solution Pietro, thanks :) I changed 2 things when using your script in my case: 1) I preferred declaring the filter in .gitattributes in the root of the repo as opposed to ~/.gitattributes, s.t. other people have the same filters as I do 2) I defined the regexp as workdir/**/*.ipynb filter=dropoutput_ipynb, and I put most my notebooks in workdir/ => if I still want to push a notebook with the output and enjoy the bookmarkable rendering in github, I just put it outside that folder.
    – Svend
    Commented Dec 24, 2015 at 16:37