Table of Contents

A while back, I put together a tutorial on how to accept GitHub Classroom assignments and clone a repo. Although GitHub Classroom is designed for educators to manage coding assignments, it’s built on GitHub, an online platform that hosts Git repositories and provides tools for version control, collaboration, and project management. Beyond the classroom, GitHub is widely used for personal projects, open-source contributions, and professional development portfolios.

Ensure Git is Installed

Before using GitHub Desktop, make sure Git is installed on your computer. Additionally, consider installing Git Large File Storage (LFS) for projects involving large files (>2MB), such as game development with assets.

Creating a Repository

To get started using GitHub, you need to create a repository (repo), which acts as the container for the project. The repo can be initially created either remotely or locally and then synced back and forth.

🛠 Create A Remote Repository

📝 Version Control | 🕑5 minutes | Required Files : none

Step 1: Log In to GitHub

  1. Open GitHub in your Web Browser
    Log in to your GitHub account in a web browser.
  2. Navigate to Your Profile and Repositories
    Go to your Profile page and click on Repositories to view your existing repositories.

Step 2: Create a New Repository

  1. Click on the New Button
    Once you’re in the Repositories section, click the New button to create a new repository.
Choose "New" to create a repository
Choose “New” to create a repository

Step 3: Set Up Your Repository

  1. Configure Repository Settings
    On the next page, set up your project repository by naming it, adding a description, and choosing any other settings like adding a README, .gitignore, or a license. Once you’re ready, click Create Repository.
New repo setup - GitHub
New repo setup – GitHub

Step 4: View Your Repository

  1. View Your New Repository
    After creation, you’ll be redirected to the GitHub repository page. It should look similar to the screenshot below:
Repo on GitHub
Repo on GitHub

We have successfully created a remote repository for the project. To access this repository locally on your computer, follow the steps for Cloning a Repository.

🛠 Cloning a Repository

📝 Version Control | 🕑5 minutes | Required Files : none

In order to work on a GitHub repo you will need to create a local copy. There are several methods for cloning repos. For this tutorial, we will be using GitHub Desktop.

Step 1: Open GitHub Desktop and Log In

  1. Launch GitHub Desktop
    Open GitHub Desktop on your computer.
  2. Log In to Your Account
    Make sure you are logged in to your GitHub account in the desktop app.

Step 2: Clone the Repository

  1. Navigate to Clone Repository
    In GitHub Desktop, go to the menu bar and click File > Clone Repository.
In GitHub Desktop choose Clone Repository
In GitHub Desktop choose Clone Repository

Step 3: Select Your Repository

  1. Choose from Your Repositories
    A new window will appear displaying all the repositories available in your GitHub account. Select the repository you want to clone locally.
Select the repository to clone
Select the repository to clone

Step 4: Clone via URL (if needed)

If you have a large number of repositories or if you are cloning a GitHub Classroom Assignment, you may want to use the URL option.

  1. Click the URL Tab
    In the dialog box, click the URL tab at the top.
  2. Copy the Repository URL
    On the repository page, click the Code button. From the dropdown, copy the HTTPS URL of the repository.
GitHub repository URL
GitHub repository URL
  1. Paste the GitHub URL
    Return to GitHub Desktop and paste the copied repo URL
  2. Set the Clone Location
    Choose the folder where you want to save the repository on your local machine, then press Clone.
Set the Git URL for the clone repository
Set the Git URL for the clone repository

Cloned Repo Save Location

Make sure you select the correct location to save your local repository. In the example above, I have my students save their cloned repositories on the D: drive using the following folder structure:D:\Students\YourName.

Once cloned, you’ll have a local copy of your repository and can begin making changes that sync with GitHub.

🛠 Create A Local Repository

📝 Version Control | 🕑5 minutes | Required Files : none

There are times where you might want to start with a new project by creating a local repository local repository directly from GitHub Desktop and then later sync it with a remote repository.

Step 1: Open GitHub Desktop

  1. Navigate to New Repository
    Open GitHub Desktop, and go to File > New Repository.

Step 2: Set Up Your Local Repository

Configure Your Repository
Just like when creating a remote repository, provide a name, description, and set any additional options such as README, .gitignore, or license.
Ensure you specify the local path where the repository will be saved on your computer.

New local repo from GitHub Desktop
New local repo from GitHub Desktop

Step 3: Save Your Local Repository

  1. Create Your Local Repository
    After setting everything up, GitHub Desktop will create your local repository. However, this repository is not yet saved to the cloud.

Step 3: Save Your Local Repository

  1. Create Your Local Repository
    After setting everything up, GitHub Desktop will create your local repository. However, this repository is not yet saved to the cloud.

To upload your changes to GitHub and sync them with the cloud repository, you will need to commit changes and push to origin. If you need a refresher on that process, check out this earlier guide where I walk through the steps in detail.

Tagged in:

,