Open In App

How to Upload Project on GitHub from Jupyter Notebook?

Last Updated : 05 Aug, 2021
Like Article

A Jupyter notebook is neither a simple text editor nor a full-featured IDE, rather it is an electronic file which contains both programming code and text descriptions. It can also contain embedded charts, plots, images, videos, and links. They run in a web browser like Firefox or Google Chrome. 

They can contain code of various programming languages, though are mainly popular for Python with .py extension, they also support Markdowns with .md extension. One way to think of a Jupyter notebook is as a combination of the Python REPL and a Python module .py file with a markdown .md file thrown in between code sections.


The simplest way to install Jupyter notebooks is to download and install the Anaconda distribution of Python. The Anaconda distribution of Python comes with Jupyter notebook included and no further installation steps are necessary. 

You can install of Anaconda in windows.

Uploading project on Github from Notebook:

Once it is installed, open the Anaconda Navigator to get started with jupyter Notebook. 

Here, launch the Jupyter Notebook.

A Jupyter file browser will open in a web browser tab, you will see your base(home) directory. 

There in the upper right section, you can click the New(dropdown) -> Python3

After that, a New tab of Jupyter notebook will open in you browser.

Now, click on the Untitled -> Rename prompt will open -> Rename your file.

You can also click the code dropdown and select the Markdown field for explanation(paragraphs) or the Heading field for heading.

Then write some code in the Notebook. To Run the code, press the Run button as depicted in the picture above. 

So, this is our code:

Upload project directly into Github without using Notebook:

  1. Click on File -> Download as -> Notebook(.ipynb)
  2. Make a new repository into Github.
  3. Click Add Files -> Create New File.
  4. Browse through your directory and upload your file (example filename: GeeksForGeeks.ipynb) and click Open.
  5. Commit the changes.


Upload project using git commands:

Note: Git should be installed in the system.

Open the download location of the file (example filename: GeeksForGeeks.ipynb) in command prompt.

Then, make a new repository in GitHub. And use the below commands in command prompt:

1. git init
2. git add  
3. git add GeeksForGeeks.ipynb
4. git commit -m "notebook first commit" 
5. git remote add origin{Your repo}/GeeksForGeeks.git 
6. git push -u origin master 

Great! Now you have uploaded your first Notebook Code into GitHub.

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads