How do I edit an ipynb file on github?

Viewed 3724

I have a repository on GitHub where I uploaded a Jupyter Notebook file. I created another branch and want to edit the ipynb file.

Clicking the edit button produces an HTML file which is really confusing. I want to edit the ipynb file and run it before pushing the commit. How do I do this, please?

3 Answers

The short answer is no, you can't edit an .ipynb file directly on Github. At least, you can't edit it in the interactive way that you can using Jupyter Notebook. If you know what you are doing, you can edit the JSON, but that doesn't seem like a very good way to do it. Instead, just clone your repo locally to edit it.

You cannot edit a .ipynb file on github. You have to clone the repository on your device , checkout the branch and start editing

.ipynb files can't be edited on GitHub online, but you can do it through GitHub Desktop.

  • Clone the repository which has the file you want to edit, on GitHub Desktop.

  • Select 'see files in explorer'. It opens the folder in which the files from your repository have been cloned. It might be called something else if you're not on Windows.

  • Open the relevant file(s) and make the changes and save it.

  • On GitHub Desktop, select the relevant repository from the 'current repository' menu on the top left if the repository is not already selected. You'll see the changes you've made when you select the file from the left pane.

  • Select the file(s) you've made changes to.

  • Click on the 'Commit to main' button on the bottom left corner. This will commit the changes to your local repository i.e. the cloned repository on your system.

  • Click on the 'Push origin' button on the top pane. This will commit the changes to your repository on the GitHub website.

Related