Set up version control for your game project

Tutorial

Beginner

+0XP

20 mins

Unity Technologies

Set up version control for your game project

This tutorial introduces version control by guiding you through setting up Git and GitHub for your Unity game project, helping you protect your work and prepare for collaboration. You’ll follow a step-by-step process to create and configure a GitHub repository, add Unity-specific settings, place your project under version control, and confirm that your setup is working correctly.

1. Overview

Version control is a system that tracks and manages changes to your project files over time. Think of it like a detailed save history for your entire game project: a complete timeline of every change you've ever made, with the ability to go back to any point.

illustration of a floppy disk with the word ‘SAVE’ on it.

In this tutorial, you'll follow a step-by-step version control setup guide to create a GitHub repository for your game project. You'll install GitHub Desktop, configure your repository with Unity-specific settings, move your game project into version control, and verify that everything is working correctly.

2. Why is version control important for game dev?

As a game developer, version control becomes essential whether you're working alone or on a team. Solo developers need protection against hard drive failures, the ability to experiment without risking their stable build, and access to their project from multiple computers.

For teams, version control allows multiple people to work simultaneously while coordinating changes between artists, programmers, and designers. It's an industry-standard tool that professional game developers use every day, and learning it now will make you more prepared for real-world game development.

Illustration of a series of connected differently colored rectangles intended to represent a series of connected branches in version control.

3. Set up version control for your project

In the previous tutorial, you chose whether you’re going to work on your 3D game, your 2D game, or both in this learning pathway. Now, you'll set up version control for the Unity project you'll be focusing on.

1. Open the tutorial, Get started with GitHub Desktop and follow the step-by-step instructions to install GitHub Desktop, sign into GitHub, and create a new repository.

2. Open the tutorial, Connect a Unity project to GitHub Desktop and follow the step-by-step instructions to move your Unity project into the repository folder, understand the GitIgnore file, and make your first commits in your project.

Important: The tutorial linked above gives you instructions for setting up version control on a project named "Jr-Programmer-Project". Instead of doing that, you'll be setting up a repo for your "3D-game-project" or your "2D-game-project". When you create your repository in GitHub Desktop, use the name “3D-game-project” or “2D-game-project” depending on which game you're working on (or create separate repositories for both if you're working on both games).


4. Verify your steps are complete

If you've followed the tutorial correctly, you should be able to complete these verification steps:


Check 1: View your repository online

With GitHub Desktop open, select Repository > View on GitHub from the top menu. This should open your web browser showing your project files online, including your repository name, commit history, and project folders.

Screenshot of github.com showing the main project files within a project named ‘3d-game-project’.

Check 2: Test change detection

Open your game project in Unity and make a small change, like creating a new C# script called "TestScript". Switch to GitHub Desktop and check the Changes panel - you should see your new files listed with a green plus (+) icon, indicating GitHub Desktop is tracking modifications to your game.

In the  Changes panel of Github desktop, two new files highlighted, one of which is ‘TestScript.cs’


5. Next steps

With version control set up, you're ready to start building upon your game safely, or even invite collaborators. Remember to commit your changes regularly whenever you complete a feature or reach a stable point in development.

If you want to learn more about GitHub, including setting up large file support, creating branches, and dealing with merge conflicts, check out our full course, Collaborate with GitHub Desktop.


Complete this Tutorial