Git with Unreal Engine 5

Pushing 75GB in one commit. In this guide, we will have a look at how well Git is suited for collaboration and version control with Unreal Engine 5.

Matthäus Niedoba
January 25, 2023
min read


If you never heard of source or version control, the beginner's article on collaborating on Unreal Engine is a better choice. If you already know how to use Git and are looking for a "how to" tutorial, then check out the article on Unreal Engine with Git and Azure DevOps.

Git is a source control system that allows you to collaborate on an Unreal Engine project. Unreal Engine 5 works well with Git because of the introduction of one file per actor. This allows multiple people to work on the same map at the same time.

Git is the most popular version control (or source control) system among developers. This is due to it's open source code and the popularity of GitHub. The Unreal Engine source code is also available on GitHub. When it comes to game development, you need a version control system like Git, Perforce, Plastic, or SVN to help you work together by distributing your files, communicating with each other, and having a safety net to fall back on if something goes wrong. We take a closer look at Git in this article. And yes, because we are developers of Anchorpoint, there will be some mention of Anchorpoint as well.

About Git

Git was developed by Linus Torvalds to manage the open source development of the Linux kernel. It's designed to work locally (without an Internet connection) on a large code project. When it comes to code files, Git is inherently fast at tracking changes and creating branches (like variations of your project). Git thinks in terms of complete project versions, rather than just a single file version. A project version is called a commit. It's a collection of files that have been changed by a developer to implement a new feature or fix a bug.

Git is also a "distributed" version control system for the source code. This means that everyone has a copy of the project on their computer. They can work on it even if the server is down.

Advantages of Git

Anchorpoint is part of the git ecosystem of tools and services

Huge ecosystem of tools and services

There are a lot of tools and cloud hosting providers based on Git because it is open source. Basically, it's an open standard. This means there is no lock-in to a particular provider. You can choose if you want to host a Git server locally or if you want to use a cloud service like GitHub.

There is also a huge landscape for desktop applications. Developers and artists are sure to find something that is right for them.

Low cost

In comparison to Git's competitors, you can run it for free or at lower costs for file hosting or subscriptions if you need better options. For example, hosting a Git repository on Azure DevOps costs as little as $6 per user per month. There are no additional fees for storage.

Fast and reliable

Because of its distributed nature, Git can work offline. It's fast at creating branches, restoring files, or detecting new changes. If the server goes down, you don't have to worry.

A superior UX

Most of the time you'll hear this argument about the drawbacks of Git, because it's a command-line only application by its very nature. But to be honest, the only people who use it are the people who love the command line. For normal people, there are many desktop applications like GitHub Desktop or GitKraken for developers and Anchorpoint for artists. Also, compared to Git's competitors, cloud services like GitHub, GitLab or Azure DevOps make it very easy to manage Git projects in the cloud.

Git for Unreal projects

Built-in LFS support, no complicated configuration and an artist friendly user interface.
Learn about Anchorpoint

Disadvantages of Git

No access control

There is no granular access control. Once you give someone access to a project, they have access to everything in that project. You cannot restrict access to specific folders as you can with Dropbox.

Eats up more disk space

Because of it's distributed design, Git can work offline, but it also has to create a lot of cache. This cache is basically the same size as your project files. So if you use Git, you will more or less need twice as much disk space as your project size.

The Git implementation checklist

When using Git as your version control system, you need to think about three things:

Choosing a Git Server

The easiest way is to use a Git server in the cloud like GitHub, AWS Code Commit, GitLab or Azure DevOps. We have done a comparison of them with a focus on Unreal Engine projects, which will save you hours of googling.

Git on your computer

Unless you want to use the Git command line, which I'm assuming you don't because you're reading this article, you can use a desktop application that connects to the server and pushes (uploads) and pulls (downloads) files to and from the Git server.

If you are a developer and need more options for comparing code, etc., you can go for tools like GitHub Desktop, GitKraken, or SourceTree. If you're an artist, Anchorpoint is the best choice because it takes away the complexity and is optimized for Unreal and Unity projects.

Configure Git by setting the .gitignore and .gitattributes file

Anchorpoint does all this automatically, but if you don't want to use it, you'll need to install Git LFS, which stands for Git Large File storage and is the extension for handling binary data.

To use Git LFS, you need to mark the appropriate file types in the .gitattributes file. This is the configuration file for Git. The .gitignore file filters file types and folders that should not be uploaded to the git server. In most cases these are cache files created by the Unreal Engine. Here you can download a preconfigured .gitattributes and .gitignore file. Place the .gitattributes file in the root folder of your repository and the .gitignore file in the folder where your Unreal Engine data resides.

Git in Unreal Engine

You may have seen that Unreal Engine comes with a git plugin marked as beta. We don't really recommend using it because it slows down the engine. Use a desktop application or the command line if you want.

Unreal Engine 5 comes with special features for collaboration. First, there is World Partition, where maps are automatically divided into a grid. And most importantly, changes are made at the actor level. So when I place a tree, the coordinates are not stored in the level file, but in a separate file that is very small. This way you avoid conflicts or blocking your teammates by file locking. Also, committed changes have a relatively small file size, since the level does not have to be re-uploaded.

How to convert a map to World Partition in Unreal Engine
Use World Partition to make use of one file per actor. You can convert an existing map to a World Partition map using the "Convert Level..." command

Workflow recommendations

Don’t go crazy with branches

If you are a small team (less than 10), put all artists on a single branch. If conflicts arise, they can be resolved immediately. You don't want your artists to work on their own branch for a week, and then spend a whole day merging and resolving conflicts when they've forgotten what they were working on. If there is a conflict, resolve it immediately.

The developer should only do the branching

The developer is the technical master and will have a better understanding of branches. It's hard to explain the concept of branches to an artist. Just let them work on a branch and not change it.

Push and pull often

Do this at least once a day. Don't push everything at the end of the week. You will create a lot of conflict. Regular pushes and pulls will keep everyone on the team in sync.

Write meaningful commit messages

This is a hard habit for artists to get into, because it's natural to write "made some changes. Getting into the habit of writing good commit messages will make the whole game development process transparent and avoid confusion. It's the same as naming your files.

In conclusion

Git is a fast and reliable version control solution that works well for small and medium sized teams. It's the easiest way to collaborate in Unreal Engine and has the largest ecosystem of tools and services. If you want to set it up for your own project, take a look at this tutorial on how to set up Git and Azure DevOps for an Unreal Engine project. If you want to make Git easy to understand for artists, try out Anchorpoint.