We can break down your specific workflow into two distinct Gitflows for the course:
- Initial Setup: Setting Up Your Local and Remote Git Repos
- Weekly Workflow: Working on Assignments
In this walkthrough, we’ll cover the Initial Setup.
You might be wondering: "How do I make changes to this very repo that I’m reading right now?"
Short answer: You don’t!
Let’s set up the repo that you will make changes to every week when doing your assignments.
First, do these things:
- Set up your SSH key on GitHub.com.
- If you're on Windows, set up Windows Subsystem for Linux (WSL2).
You can follow this guide if you need to, but creating a blank repo is pretty straightforward. A few notes on the seeing you should use, as shown below.
- Please use the repository name that corresponds to your cohort! e.g., AIE9, AIEO2, etc. Don't get fancy with the name - your life will be easier if you keep the name simple.
- The process will be easiest if you make sure Add a README file is deselected.
🎉 Congrats! You’ve just created an empty remote repository on GitHub.
2️⃣ Get Secure Shell Protocol (SSH) Address
Once you've created your new repository, copy the repo’s SSH address. You'll want to copy this address as shown below. Click the 'copy' icon at the end of the address bar
Execute the command:
git clone git@github.com:yourusername/yourrepo.git
Then we need to Change Directory, or cd into our newly cloned repository!
cd yourrepo
*If you see a warning message like:
warning: You appear to have cloned an empty repositorythat means you've done everything right!
🎉 Congrats! You’ve just cloned your empty remote repo locally to your machine using an SSH key.
First, run this command (but make sure to replace the XX with your cohort number):
git remote add upstream git@github.com:AI-Maker-Space/AIEXX.gitVerify both remotes are connected. You should see both "origin" (your repo) and "upstream" (class repo).
git remote -v
You should see an output very similar to this (your origin will be a different address)
origin git@github.com:chris-alexiuk/AIEO1.git (fetch)
origin git@github.com:chris-alexiuk/AIEO1.git (push)
upstream git@github.com:AI-Maker-Space/AIEO1.git (fetch)
upstream git@github.com:AI-Maker-Space/AIEO1.git (push)
🎉 Congrats! You’ve just connected AI Makerspace’s remote class repo (which we manage) to your remote class repo (which you manage)!
5️⃣ Your First Pull
It’s time to pull down the course materials from AI Makerspace’s remote repository, which is upstream of both your local and remote repos.
*You will do this each week as new assignments are released!
git pull upstream main --allow-unrelated-histories🎉 Congrats! You’ve just pulled down course materials from AI Makerspace’s remote repo, down to your local repository.
6️⃣ Your First Push
Now we need to push everything up from our local repo to our remote repository on GitHub.com
git push origin main🎉 Congrats! *You just pushed the course materials in your local repo up to your remote repo (origin) on GitHub.com.
During steps 5️⃣ and 6️⃣, notice the use of
main.mainis simply the name given to the default branch in a repo.
- What are three lessons you've learned from this?
- What is one lesson that you have not yet learned?

