Setting Up Version Control with Github for Desktop
Version Control in Unity projects is vital for collaboration, as well as backing up your data.
Version Control allows you to have a local version of a game project (or to be specific, just a folder will files in), and a cloud version which acts as the 'main' version of the game project.
You are then able to download anything that is different from the main version into your local version (known as pulling or fetching) and update that main version with changes you make (known as pushing or committing).
The system we will use for this will be Github. You can make an account with your college email here:
You can then log into Github for Desktop when you launch the application. If you haven't installed the application at home, you can do so here:
You are then able to log into your account on the desktop client.
Setting up a Project
When you are logged into Github for Desktop, the first thing we need to do is set up a Repository. Think of this simply as a folder that we are going to use for Version Control. You might want to make this somewhere easy to remember, such as in your Documents or N:\ drive.
In Github for Desktop, click FILE > NEW REPOSITORY or click CTRL + N.

Some settings to note here are the local path (basically just where you want the folder to be), and for this I chose my N:\ drive. I also set up a Git Ignore for Unity (it's in the drop-down list) as this means we don't need to upload and download files that are part of Unity and that don't really change (e.g. engine files).
Next, drag your Unity project into that folder on your computer. You need to have Unity closed to move files around.
Once you've created this and put files into it, we then need to Publish our Repo:

Clicking that option will allow yourself and others to download and work on the project.

Simply click publish!
Fetching from the Repo
When you start working on your project each day, it's a good idea to Fetch the most recent update. We can do this by clicking FETCH ORIGIN at the top of the screen:

This will give you an update of the things that have changed, and the option to update your local version with those changes.
Committing to the Repo
Similarly, when you are finished with the changes you've made, you can simply push your changes to the repo by clicking COMMIT TO MAIN in the bottom-left of the screen:

Note that you have to describe the changes you've made in the summary box; this can't be blank.
Adding Team Members
First we need to log into Github in the browser.
Click on the repo you want to add people to on the left of the screen:

Click SETTINGS in the top toolbar:

Choose COLLABORATORS:

Then, add your collaborators (team members) by email. If they don't have a Github account, it will give them the option to create one. Then, they can log into Github for Desktop and Fetch the Repo!

Last updated