r/IPython • u/gstoel • Oct 02 '15
How to use git with iPython notebooks
I love the interactive and flexible environments of iPython. But I hate it I seem unable to get effective version control in using git. executing a cell already results in a diff :(
Anyone using git with iPython notebooks and if so, how do you use it and is it efficient?
13
Upvotes
3
u/my_name_is_jody Oct 02 '15
There are several stack overflow answers on the topic. I've also found some good info in other places. I'll try to dig them up later when I'm not on mobile, bit the gist is you can setup a git filter to fix parts of the metadata that shouldn't change from commit to commit. You can also set it up to strip out the run count and output. Finally, for code review sanity, you can get ipython/Jupyter to export the notebook as a script as well. This way, when you look at the different, you can read the python script version, but you can also still access the notebook. I'll see if I can find the links later tonight.