Version Control
Curriculum Focus: Apply version control tools to protect and manage game development projects.
Total Time: ~50 minutes
Teach (I Do)
The Problem
Some students in this class have already lost weeks of work because a school computer was reimaged. The files were gone — no warning, no recovery. This is a real problem that happens to developers everywhere, at every level.
The fix is simple: version control.
What Is Version Control?
Version control is a system that saves snapshots of your project over time and stores them safely online. It means:
- Your work is backed up to the cloud — even if this computer is wiped tomorrow, your project is safe.
- You can undo changes and jump back to any earlier version of your project.
- You can see exactly what changed, and when, going all the way back to the start.
A Gaming Analogy
Think of version control like save states in a game — except for your entire project.
| Gaming Concept | Version Control Equivalent | What It Does |
|---|---|---|
| Checkpoint / Save State | Commit | Saves a named snapshot of your project right now |
| Load State | Revert | Rolls your project back to a previous commit |
| Cloud Save | Push | Uploads your commits to GitHub on the internet |
| Load Cloud Save | Pull | Downloads the latest version from GitHub |
Key Terms
| Term | Simple Explanation |
|---|---|
| Repository (Repo) | The "project folder" that stores your files and their full history |
| Commit | A saved snapshot of your project at a point in time, with a label you write |
| Push | Uploading your commits to GitHub so they are stored online |
| Pull | Downloading the latest version of a repo from GitHub |
| Private Repository | A repo that only you — and anyone you specifically invite — can see |
| GitHub | The website that hosts your repositories online |
| GitHub Desktop | A free app that makes version control click-based — no typing commands required |
Why Developers Use It
- Backup: Work is always safe, even if a computer dies, gets wiped, or is stolen.
- History: Every version of your project is stored. You can always go back.
- Confidence: You can experiment and try things — if it breaks, you can undo it.
- Collaboration: Teams can work on the same project without overwriting each other.
Real Talk
Nearly every professional game studio in the world uses version control. Nintendo, Valve, CD Projekt Red, and every indie developer you admire all use it. Learning it now gives you a real industry skill.
Check Your Understanding
Answer these in your workbook before moving on:
- In your own words, what is a repository?
- What is the difference between a commit and a push?
- How is a commit similar to a checkpoint in a game?
- Why would a student want their repository to be private?
- If the students who lost their projects had been using version control, what would have been different?
Model & Guide (We Do)
Follow along step-by-step. By the end, your Unity project will be safely backed up to GitHub.
Step 1 — Create a GitHub Account
- Open your browser and go to github.com.
- Click Sign up.
- Enter your school email address, then create a username and password.
Choosing a Username
Your GitHub profile is a portfolio — future employers and universities may look at it. Keep your username professional.
pixel-tom,tmdev,gamedev-studioxX_gamer123_Xx,tommo2008
- Complete the verification and click Create account.
- Check your email and click the verification link GitHub sends you.
Step 2 — Sign In to GitHub Desktop
- Open GitHub Desktop from the Start Menu.
- Click Sign in to GitHub.com.
- Your browser will open — click Authorize GitHub Desktop.
- Return to GitHub Desktop. Your username should appear in the top-right corner.
Step 3 — Add Your Unity Project
- In GitHub Desktop, click File > Add Local Repository.
- Click Choose... and navigate to your Unity project folder.
- GitHub Desktop will show a message: "This directory does not appear to be a Git repository."
- Click the blue "create a repository" link inside that message.
- Fill in the details:
| Field | What to Enter |
|---|---|
| Name | A clear name for the repo (e.g. FlappyBird-Unity) |
| Description | A short note (e.g. Year 9 GameDev - Flappy Bird project) |
| Local Path | Should already point to your Unity folder — leave it |
| Git Ignore | Select Unity from the dropdown |
- Click Create Repository.
The Git Ignore Setting Is Important
Unity projects generate large temporary files (like the Library folder) that don't need to be saved. Selecting the Unity Git Ignore template tells GitHub to skip these automatically — keeping your repo clean and fast to upload.
Step 4 — Make Your First Commit
You should now see all your project files listed under Changes, ready to be committed.
- Look at the bottom-left panel — you'll see a Summary text field.
- Type a clear commit message, for example:
Initial commit - Flappy Bird Unity project - Click Commit to main.
Writing Good Commit Messages
A commit message is like a diary entry for your project. Anyone reading it (including future you) should understand what changed.
Add player jump mechanicFix pipe spawning bugInitial commit - project setupstuffaaaaaa
Step 5 — Publish to GitHub (Private)
- Click Publish repository at the top of GitHub Desktop.
- Make sure "Keep this code private" is ticked.
- Click Publish Repository.
- Open your browser, go to github.com, and sign in.
- Click your profile icon — your new repository should be listed there.
You're Backed Up!
Your Unity project is now safely stored on GitHub. Even if this computer is reimaged tomorrow, your work is safe. Every commit you make from now on adds to that safety net.
Apply & Extend (You Do)
Now practise the commit-and-push workflow on your own.
Task 1 — Make a Change and Commit It
- Open your Unity project and make a small change:
- Move a GameObject in the Scene
- Adjust a value in the Inspector
- Add a comment to a script
- Save the scene in Unity (Ctrl + S).
- Switch to GitHub Desktop.
- Your change will appear in the Changes tab.
- Write a short commit message describing what you changed.
- Click Commit to main.
- Click Push origin (top-right) to upload it to GitHub.
Task 2 — Review Your History
- In GitHub Desktop, click the History tab (at the top).
- You should see both commits listed with their messages and timestamps.
- Click on each commit to see which files changed.
Check Your Understanding
- What does the green
+mean next to a line in the file changes view? - What does the red
-mean? - Why is it better to commit often rather than just once at the very end?
Extension — Explore GitHub.com
- Go to your repository page on github.com.
- Click on a file to read its contents directly in the browser.
- Click the clock/commits icon near the top of the file list to see your commit history.
- Click on a commit to see exactly what lines were added or removed.
Review
The essentials — commit these to memory:
- Repository: Your project folder + its complete history, stored safely online.
- Commit: A named snapshot. Make one whenever you finish something meaningful.
- Push: Sends your commits to GitHub. Do this at the end of every session.
- Private repo: Only you and people you invite can see it.
- GitHub Desktop: The app that makes all of this work with clicks — no commands needed.
Choose one review task:
Option A — Exit Ticket: Write three sentences: What version control is, why it matters, and one habit you will adopt in your next project.
Option B — Quiz Me Quick:
- What is a repository?
- What does "commit" mean, and when should you do it?
- What does "push" do, and why is it important?
- Why should you select the Unity Git Ignore template?
- What would you do if you accidentally broke something in your project and needed to go back to a working version?