DEV Community

Cover image for Link Jupyter Notebook to Github
Jo
Jo

Posted on

7 4

Link Jupyter Notebook to Github

This post will explore (and serve as a personal reference) for linking a jupyter notebook to github. This guide assumes you have a github account, basic knowledge of git and the command line, and is currently using Jupyter notebook.

Firstly, spin up jupyter notebook using your CLI and this command:



jupyter notebook


Enter fullscreen mode Exit fullscreen mode

This should bring you to the jupyter notebook interface as seen as the screenshot below:

Click the dropdown on the right, and select "Python 3". This will spin up the IDE, which you can then name appropriately. For this example, I copy pasted code from W3Schools.

The below screenshot is the result:
jupyter notebook example code and accompanying visualization

Great. Now we have the code. In Jupyter, go to "File" and go to "Download As:", select "Notebook"(.ipynb)

Now, sign into your github account, and create a new repository. On the Quick set up page select the "…or create a new repository on the command line" option
Github repo setup options
Copy paste the code into your command line like so:
git command

Go back to github and refresh the page.
Github add new files page
Select "Upload files".
Choose the file you've just downloaded from the jupyter gui and select "Commit changes". This will then take you back to the file screen where you can now click on the file you just uploaded. The screenshot below shows the final result.
Code and viz on github-final result

Your jupyter notebook work is now shareable to others.

API Trace View

Struggling with slow API calls? 🕒

Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay