top of page

Welcome
to NumpyNinja Blogs

NumpyNinja: Blogs. Demystifying Tech,

One Blog at a Time.
Millions of views. 

GitHub Workflow for Beginners – Step by Step Using Jupyter Notebook

Oct 21
6 min read

Introduction

When we work on a Python project, we create files, write code, make changes, and save our work. But what if we are working with a team? How do we share our code? How do we make sure that one person's changes do not affect another person's work?


This is where GitHub helps us.


GitHub is a platform where we can store our project files, track the changes, and work together as a team.


When I first started learning GitHub, I came across terms like repository, branch, commit, push, pull, and pull request. Initially, these terms were a little confusing. But once I started using GitHub Desktop along with Jupyter Notebook, I understood how the process works.


In this blog, I will explain the GitHub workflow step by step, starting from creating a repository to uploading our Python code and merging it into the main branch.


We will use GitHub Web, GitHub Desktop, and Jupyter Notebook.


Step 1: Create a Repository in GitHub

First, we need to create a repository.


A repository is nothing but a folder in GitHub where we can keep all our project files.


Let's create one.

  1. Go to github.com and log in.

  2. Click the + icon at the top-right corner.

  3. Select New repository.

  4. Give a name to your repository. For example, Python-Data-Analysis.

  5. You can add a description if you want.

  6. Select Public or Private.

  7. Check the option Add a README file.

  8. Click Create repository.


That's it! Our repository is created.


You will also notice a branch called main. This is the main branch of our project.

 

Creating a repository in GitHub.


Step 2: Create Your Own Branch

Now we have a repository. The next step is to create our own branch.


You may wonder, why do we need another branch when we already have main?

Let's say four people are working on the same Python project. Everyone is working on different tasks.

Instead of making changes directly in main, each person can create their own branch and work separately.

Once the work is completed and reviewed, we can merge the changes into main.


Let's create a branch.

  1. Open your repository in GitHub.

  2. Click the branch dropdown where you see main.

  3. Type your branch name, for example, I am naming my branch lilly. You can give any name to your working branch.

  4. Click Create branch from main.

Now our branch is ready.


Whatever changes we make in this branch will not directly affect the main branch.

 

Creating a new branch.



Step 3: Create a File in GitHub

Now let's create a simple file in our branch.

  1. Select your working branch.

  2. Click Add file → Create new file.

  3. Give a file name, for example, project_notes.md.

  4. Write a few lines about your project.

For example:

Python Data Analysis Project

In this project, we will use Python to clean data, perform basic analysis, and create visualizations.

Once you finish writing:

  1. Click Commit changes.

  2. Enter a message, such as Added project notes.

  3. Save the changes to your branch.

Now our first file is created.

Here, we came across a new term called Commit.

Commit simply means saving the changes we made in our project so that Git can keep track of them.

 

Creating a file and committing the changes.

 


Step 4: Clone the Repository Using GitHub Desktop

So far, we have created a repository, branch, and file on GitHub Web.

Now we want to work on our Python code using Jupyter Notebook.

For that, we need to bring our GitHub repository to our computer.

This is called Cloning.

Cloning simply means downloading a copy of our GitHub repository to our local computer.

Let's see how to do it.

  1. Open GitHub Desktop.

  2. Log in with your GitHub account.

  3. Click File → Clone repository.

  4. Select your repository.

  5. Choose a folder on your computer where you want to save it.

  6. Click Clone.

Once cloning is completed, select your working branch in GitHub Desktop.

 

If you don't see your branch, click Fetch origin to check for the latest branches.

Now we have our project folder on our computer.

 

 Cloning the repository in GitHub Desktop.



Step 5: Create a Python File in Jupyter Notebook

Now let's open Jupyter Notebook and create a simple Python file.

  1. Open Jupyter Notebook.

  2. Go to the folder where you cloned your GitHub repository.

  1. Create a new Python notebook.

  2. Rename it to employee_analysis.ipynb.

Let's write a simple Python code.

import pandas as pd

data = {

    'Employee': ['John', 'Mary', 'David'],

    'Salary': [50000, 60000, 55000]

}

df = pd.DataFrame(data)

df

When we run this code, we can see the employee details in a table.

Now let's calculate the average salary.

df['Salary'].mean()

Output:

55000.0

Once the code is working correctly, save the notebook using Ctrl + S.

Now our Python notebook is saved inside our local GitHub repository folder.


Creating and running Python code in Jupyter Notebook.


Step 6: Commit and Push Changes Using GitHub Desktop

Now that we have created and saved our Python notebook, the next step is to upload it to GitHub.

Let's open GitHub Desktop.

  1. Open GitHub Desktop.

  2. Go to the Changes tab.

  3. You will see the Python notebook we created.

  4. Review the changed files and select the files you want to commit.

  5. Enter a meaningful commit message, for example, Added employee analysis.

  6. Click Commit  – this saves our changes to our local working branch (lilly).

  7. Click Push origin – this uploads our committed changes to our branch (lilly) on GitHub Web.

Now our Python notebook is uploaded to our working branch on GitHub.

Here, we learned two important terms:

Commit: Saves our changes to our local branch on our computer.

Push: Uploads our committed changes from our local branch to the corresponding branch on GitHub Web.

We can now open GitHub Web, select our branch (lilly), and check whether the notebook has been uploaded successfully.


GitHub Desktop showing the notebook, commit message, and Push origin option.



Note: Our changes are available only in the lilly branch at this stage. They will be added to the main branch after we create and merge a Pull Request.

 

Step 7: Create a Pull Request

Now our Python file is available in our branch on GitHub.

But how do we move it to the main branch?

For that, we need to create a Pull Request, also called a PR.

A Pull Request is nothing but a request to review our changes and add them to another branch.

Let's create one.

  1. Open GitHub Web.

  2. Go to your repository.

  3. Click Compare & pull request, if it appears.

  4. Make sure you are creating the PR from your working branch to main.

  5. Give a title, for example, Added employee analysis.

  6. Add a short description of what you have done.

  7. Click Create pull request.

Now our Pull Request is created.

If we are working in a team, other team members can review our changes before merging them.


Creating a Pull Request in GitHub.

 

Step 8: Merge the Pull Request

Once the Pull Request is reviewed and approved, we can merge it into the main branch.

  1. Open the Pull Request.

  2. Check whether the changes are approved and ready to merge.

  3. Click Merge pull request, if you have permission.

  4. Click Confirm merge.

Our Python code is now added to the main branch.

This means the changes we made in our working branch are now part of the main project.


Merging the Pull Request into main.


 


A Few Things to Remember

While working with GitHub, there are a few simple things we should keep in mind.

  • Always check that you are working on the correct branch before making changes.

  • Run and check your Python code before saving and committing.

  • Give a meaningful commit message so that others can understand what changes you made.

  • Review the changed files before committing and pushing them to GitHub.

  • Avoid making changes directly in the main branch when working with a team.

  • Try not to work on the same Jupyter Notebook at the same time as another team member, as it may create conflicts.

  • If two team members make changes to the same file, Git may sometimes show a merge conflict. This means

  • Git cannot automatically combine the changes. We need to review and resolve the conflict before merging.

Following these simple practices can help us keep our project organized and work smoothly with other team members.


Let's Quickly Recall What We Learned

We started by creating a repository in GitHub.

Then we created our own branch and added a file.

After that, we cloned the repository using GitHub Desktop and created a Python notebook in Jupyter.

Once our code was ready, we committed and pushed the changes to GitHub.

Finally, we created a Pull Request and merged our changes into the main branch.

So our complete workflow looks like this:

Create Repository → Create Branch → Create File → Clone Repository → Open Jupyter Notebook → Write Code → Save → Commit → Push → Create Pull Request → Merge

 

Conclusion

When I started learning GitHub, I thought it would be difficult because there were so many new terms.


But after practicing these steps, I realized that the workflow is actually quite simple and easy.


We don't need to know all the Git commands in the beginning. GitHub Desktop makes it easier to manage our files and changes.


For anyone who is learning Python or Data Analytics and working on team projects, understanding this basic GitHub workflow can be really helpful.


In my next blog, I will explain how to update our working branch with the latest team changes, how to use Git Stash to save unfinished work and restore our changes using GitHub Desktop.


I hope this step-by-step guide helps other beginners understand how GitHub works with Jupyter Notebook.



Happy Reading..!!

 

 
 

+1 (302) 200-8320

NumPy_Ninja_Logo (1).png

Numpy Ninja Inc. 8 The Grn Ste A Dover, DE 19901

© Copyright 2025 by Numpy Ninja Inc.

  • Twitter
  • LinkedIn
bottom of page