A Quick Guide to Connecting Your Unity Project to Git

Matthew Givens
3 min readApr 13, 2021

While the Unity engine includes a method to backup your project to the cloud, Git is still the preferred method for collaboration because of its versatility in branching along with other features.

To get started visit Github.com and create an account to store your repositories. This will serve as the method for you to visually see the architecture of your Unity projects and seamlessly work with a team.

To create your first repository you will need to use a command line editor. Git Bash will be the example for this guide. Git Bash will facilitate the communication between your Unity project and Git.

You can find the download at the link below.

After Git Bash is installed, you can find it in your program directory or by right clicking in a folder and finding it in the context menu.

Git Bash Navigation

Git Bash functions through text commands that you will quickly become familiar with over time. To view a list of essential commands and descriptions of their functions, type the command git-- help.

The fastest method to accessing your Unity project within Git is to open its folder in windows explorer, right click, and select open with Git Bash.

Alternatively, you can also search by command using the change directory command cd.

It’s a good practice to first verify you are in the right directory by listing the contents with the list command, ls.

Connecting GitHub to your Unity project

To enable communication between GitHub and your Unity project you will first need to create a new repository on GitHub. Select the new repository button on GitHub after logging in.

Then choose a name, and be sure to add a git ignore file to avoid redundant files for collaborators.

With the git repository created, now its time to link back to your project. Start by copying the web URL of your repository from GitHub.

Next navigate to your Unity project in Git Bash and enter the git init command.

After that you will need to add your repository URL to the projects using the git remote add origin “URL” command.

Verify the connection with the git remote -v command, and you are all good to go.

--

--

Matthew Givens

A self-taught Unity developer, learning more everyday and documenting my journey. My passion for the world of game development grows with every skill I pick up.