Making a great game takes a village… and sometimes a lot more than that. Collaboration is of the utmost importance. To do this, we rely on one of the most important aspects of any software development. Version control. The concept of version control allows many people to participate in a project at the same time and maintain a clean and recoverable code base. When it comes to version control, there’s only one place to go… Git.

Installing Git

Head on over to https://git-scm.com/downloads, download, and install the latest version for your operating system.

Using Git

Before getting into the basics of Git, there’s a couple handy links to help you on your way with using Git for your projects.

Gittin’ Around

Navigating the console

GitHub

If you haven’t already, go make yourself an account on Github.com and start a new repository. Give it a name that’s descriptive of what the repository is going to contain… like the name of your game. Additionally, have git generate at least the recommended Unity .gitignore file for your repository. This will help prevent certain files from being included in the version control that don’t necessarily need to be there.

Creating a new repo with GitHub

GitHub & Your Computer: Playing Nicely

You’re going to want to follow the instructions at https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account. This will provide step by step instructions to allow your computer to communicate with your GitHub account and not run into permission errors.

Connecting Your Local Repo to GitHub

Initialize your local git repo by running git init while inside of your project folder.

Adding, Committing, and Pushing

Since we added our remote repo to an already established local Unity project, if we run git status we can see that there’s already files ready to commit! The output shown below are the parents directories ready to be staged for a commit to our remote. There are other directories in there, but they’ve been filtered out by our auto generated .gitignore file that we just pulled down from our remote.

On a quest to become a game developer. Still sometimes providing unsolicited advice about how to function in society.