1

I have an Ipython notebook file which I want to push to a collaborative shared repository on github. I tried doing

git push origin master 

but it uploaded some garbage values in the file. I want to have the same code and plots viewable to every other person on that github repo.

Please advise.

rlms
  • 10,650
  • 8
  • 44
  • 61
Baktaawar
  • 7,086
  • 24
  • 81
  • 149
  • Possible duplicate of http://stackoverflow.com/questions/18734739/using-ipython-notebooks-under-version-control – nullstellensatz Mar 26 '15 at 00:30
  • My question is I see lot of ppl having iPython notebook on their github. How do they do that?. I tried pushing one notebook and it pushed the json version. I would like to have the same way as I work on a notebook. – Baktaawar Mar 26 '15 at 03:20
  • `I tried pushing one notebook and it pushed the json version`. What did you expect? `notebooks` are just `json` files. If you want to show others the notebook rendered in html, you can share a link of that via `nbviewer`. – cel Mar 26 '15 at 08:58
  • I had a team project where we shared a common ipython notebook, to which we all periodically added code. We had exactly the same problem as you are pushing the notebook. See, the .ipynb file is basically a json text file, and git treats it as any other text file. This is a huge problem when merging changes made by other people, because conflict markers are placed within the json structure, resulting in an invalid ipython notebook. There are a number of solutions to this, but none that are standard and easy to use in any satisfying way (at least none that I could find). – nullstellensatz Mar 26 '15 at 09:04
  • Reading your question again, I probably addressed an issue you haven't run into yet. The 'garbage values' aren't garbage. That is json, which is the structure of the ipython notebook. Try opening your local notebook with a text editor (not ipython), and have a look at what is inside.. – nullstellensatz Mar 26 '15 at 09:09
  • Hi @Cel, Understood what you meant in your comments. I guess I can push my .ipynb file and in readme.md I can put the link of nbviewer. My now question is how do I add link of nbviwer to readme.md file?. Like how do I create a readme.md file in git on my local machine and also add links of nbviwer to it? – Baktaawar Mar 27 '15 at 20:41
  • @Manish, see e.g. https://help.github.com/articles/create-a-repo/, for a short introduction. – cel Mar 27 '15 at 20:50
  • @cel. Thanks. But i finally got it. Looks like the only way to ask someone to view your Ipython notebook on github is by putting a link of the nbviewer render of the notebook and adding that in the readme.md markdown file. I hope that is the only way currently right? – Baktaawar Mar 27 '15 at 22:44

0 Answers0