No Setup, Just Code: a Guide to GitHub Repositories & Codespaces Overview

by Mobolurin in Teachers > University+

41 Views, 0 Favorites, 0 Comments

No Setup, Just Code: a Guide to GitHub Repositories & Codespaces Overview

introduction image.png

This guide explains how to set up your very own Python project completely on the cloud – no installations, no hassle. You will learn a beginner-friendly workflow that will allow you to bypass the typical long set up process and begin working on your projects in just a few clicks.

This guide goes over the following key topics:

  1. Creating a Python Project on the cloud
  2. Managing your Project on GitHub
  3. Using GitHub Codespaces as an editor
  4. Sharing your Project with others

Supplies

Before you begin creating your Python project and syncing with GitHub, ensure you have:

  1. A laptop/computer for working with
  2. 8+ GB of RAM on your device to ensure adequate performance
  3. A solid internet connection

Open GitHub's Website

GitHub Sign up Page.png

Open your preferred search engine and navigate to GitHub's website: https://github.com/

Click on the Sign Up Button

Highlighted Red Sign Up Button.png

Click on the button on the top right of the page to begin setting up your GitHub account.

**NOTE**: (If you already have a GitHub Account Skip this step and head over to step 4)

Creating Your GitHub Account

GitHub create an account details filled.png

You should now be directed to the “Sign up to GitHub Page”. Fill in the following details:

  1. Your preferred email for your new GitHub Account
  2. Password for logging into your account in the future
  3. Username (Your username will be displayed on GitHub when you share your projects with others)

Navigating Your GitHub Dashboard

Repository Image Focus.PNG

You should now be automatically navigated to your GitHub Dashboard Page. This is the “home” page where you can access all your projects and interact with projects created by other people.

In GitHub, a repository is an online folder where you keep associated files for a specific project. The same way you have folders on your computer, GitHub has repositories.

Your repository pane will be empty if you have not created one before. Do not worry. Once you have created your repository it will be added to this section, and you can access it from here in the future.

To create your own repository, click on the GREEN button labelled “New”

Creating Your Own Repository

creating repository.png

To create your repository, you must decide on a couple of things:

  1. Repository Name: This might be visible to other people so choose wisely but don’t stress it. (You can always change repository name later)
  2. Description: A brief overview of what your project is about.
  3. Private/Public: This option indicates whether or not you want your project to be visible to everyone online. (click Public if you wish to share this project with others).
  4. Add a README file (optional): A file that has a more detailed overview of what your project is about, expanding on the description. It is typically written in markdown.

The rest of the options on the screen are a bit more technical and can be ignored for now.

When you are satisfied click on the GREEN “Create repository” button at the bottom of your screen.

Congratulations! 🥳🎉

finished repository.png

You have now successfully created your very own GitHub Repository! In just a few clicks you are just about ready to get started coding.

Opening Codespaces

codespaces open.png

Click on the GREEN button titled “Code” visible on your repository page.

A new menu should appear below it with another GREEN button to click on.

Once you have clicked on the second button a new tab for Codespaces should be opened.

Creating a Python File

navigating codespaces.png

There are 2 keys ways of creating and opening a python file:

  1. Through the Explorer Pane
  2. Right click on the explorer pane --> click New File --> give file a name (make sure you end with .py, e.g. “main.py”) --> press Enter on your keyboard. The Python file should be opened automatically in the “main coding area”.
  3. Through the Terminal (the cool way 😎)
  4. Click on the terminal pane and type `code main.py` and voila! Your Python file should be visible in the “main coding area”. Make sure to save the file by combining ‘Ctrl + S’ on your keyboard. (Cmd + S for MacBook)

Once you have created your Python file and it is visible in the explorer pane you can now begin adding your code. If you are stuck, feel free to copy what I have below:

A simple Hello world program

#This is EPIC!!!
'''
Fun Fact: Hello world is typically the first program that any programmer writes
'''
print("Hello world")

Uploading Your Code Changes to GitHub

uploading github.png
  1. Beside the Explorer Pane you will see an icon with a BLUE number on it. Click on it and you should see the `Source Control` tab appear in place of the explorer pane.
  2. In the Source Control tab, type out a short message indicating what changes were made to the code and click on the GREEN “Commit” button. Click on the GREEN button for any subsequent prompts (if there are any).

Your Python file should now be available on GitHub and your project is up and running!

As you continue to code and work on your project, please do not forget to continually “push” your code whenever you make changes to reflect these changes in the online repository.

Sharing Your Project With Others

showcasing.png

Copy the link from the address bar and feel free to share your project with as many people as you want!