5 Must-Read Tips To Use GIT with UNITY

At the beginning of August, our CTO, Jorge Garcia, gave a conference at the Platzi Conf in Mexico City. During his conference, we received a tweet from @hunabix.

A screenshot of a tweet from Alejandro Sobrevilla
Taken from Twitter

“Any tips or resources on how to use GIT with video game projects using Unity? Great talk in #PlatziConf”

Thanks, Alejandro! ;) You inspired us to put this blog post together and share with everyone the tips that have worked for the ICONIC Lab while using Git with videogame projects that are built with Unity.

1. Implement GitFlow

Take your time to develop and implement a coding strategy with your team. Keep in mind that the team working on a digital product and their rituals directly influences the end result of the product. For this, it's crucial to facilitate code integration. We use Gitflow to visualize our branches and as a result, it helps us make parallel programming easier.

By implementing GitFlow, we saw that the team worked more smoothly and systematic. We also found that coordinating releases is more efficient and feature-based.

If you are interested in learning more information on GitFlow click here.

2. Install GIT Large Files Storage

The look and feel of a video game is a major player in its success. To accomplish this you'll need assets that unfortunately are beyond Git file size limits. These assets can include textures, models, animations, audio, videos and binaries greater than 100MB. At the Lab, we use Git LFS, which is an open-source Git Extension for versioning large files. As they share on their website, this tool replaces large files with text pointers inside git.

You can find more information on how to use and install it by clicking here.

3. Install tools like Sourcetree

Is this your first experience using Git? Are you having a hard time getting familiar with the terminal? Sourcetree makes the integration of git within your team easier. It is user-friendly and does not require much training.

You’ll discover that by using it, you can easily implement Git LFS and Git Flow. We use this one at the ICONIC Lab, but there are several others that make the job as well such as GitKraken and GitHub Desktop.

Learn about Sourcetree by clicking here.

4. Reduce Scene conflicts

A woman using a laptop.
Photo Credits: @BruceMars from Pexels

With Unity, we can find conflicts in binary files, which are not easy to understand and solve. Trying to solve these conflicts, can end up causing a major disaster.

You can work to reduce them by having only the most essential objects in each scene. For example Managers, Canvas and any other essential object for your game.

Everything else should be worked as a prefab whenever possible, and instantiated whenever needed. This will reduce scene conflicts a lot, and ease the distribution of work between teammates based on features.

Planning the project’s architecture and the team workload is essential on every stage. Divide the workload into tasks based on features and assign each feature to a different team member.

Also, if you are working on a large feature that requires scene edition or adding elements into a scene, it is a good idea to duplicate that scene or work on a separate scene, and then integrate your work into it once it is done.

Lastly, when the time comes to integrate your work, follow a code review ritual. This is when the team lead double checks all the pull requests and make sure there are no major conflicts. Remember to make a pull of the last changes made to the code. With this, you can double-check that you are not sending conflicts with your pull requests.

Always communicate with your teammates!

5. Encourage event-driven programming

With event-driven programming, you reduce having to reference classes between each other. It will be enough to notify an action, and the interested classes will just subscribe to them. By using this programming paradigm we avoid working on the same files as someone else and forces us to create our code files as modular and reusable as possible.

In other words, each “script” will be in charge of doing only what is expected of it, listen to relevant events, and invoke events that could be of interest to others. Avoid creating unnecessary singletons and almighty scripts, which everyone must access to edit.

We hope you find this blog post in handy with your projects. Keep in mind your strategy and constant communication with your teammates as one of the most crucial factors. Do you have other useful tips? Share your best practices with us in the comment section below.

Related Posts


What we have worked on

See some examples of the types of projects and ongoing clients we work with.

See our Work
< back to blog posts