How to login to Azure DevOps (Quick Tip)
Due to the complexity of Azure services, it's often not obvious how to log in to Microsoft's Azure DevOps portal. This quick tip will show you how.
If you're new to version control and have only ever heard of "GitHub" or "Git" in the context of collaborating on a Unity project or backing up files, read on. However, if you're already familiar with Git and just need to set it up for Unity, skip to the "How to set up GitHub for Unity" section.
In this guide, you'll learn:
GitHub is one of the most popular cloud services, based on the Git version control system, and comes with several additional features that can help you manage and automate tasks. To access the GitHub cloud service, you can use Git version control commands or, much simpler, a desktop application that pushes and pulls files to GitHub like Anchorpoint.
On Git, there are plenty of possibilities, because it has the biggest ecosystem. GitHub has a free tier for unlimited users and gives you 1GB of storage. An alternative is Azure DevOps, which is free for 5 users and unlimited storage.
A Dropbox is likely to damage your project. If you have the Unity project open in a Dropbox on multiple computers (which is exactly what happens when you work in a team), Dropbox will sync files instantly. If you are working on the file (say a .unity scene) and your team member is also working on it, this will cause a conflict that Dropbox will resolve by renaming the file. This becomes a nightmare to sort out. Also, WIP scripts that are changed due to file syncing will make it impossible to launch your game.
Version control can sync files as well, but as the name says, with more control. It allows you to:
Setting up a version control solution takes only a few minutes. It's definitely one of the first things you do when you start a new Unity project. Similar to file synchronization, there are several solutions available.
Setting up GitHub for Unity is actually pretty easy and involves just a few steps. These are the components that we will use:
You can use an existing Unity project. If you are using Unity 2021 or newer, you don’t need to do any configuration. But just to double-check, make sure that asset serialization is set to force text and that meta files are set to visible. To do that, go to Edit / Project Settings:
Setting up GitHub requires just a few clicks.
In this case, we will use Anchorpoint but you can also use any other Git client. If you use another Git client, you have to create the repository on GitHub and then copy the remote URL to your Git client. In Anchorpoint, we will use the GitHub integration.
You want to make daily committing a habit in your workflow. You make a significant change (e.g., you created a new version of your character or implemented a major change to a game mechanic), then you want to commit it. Git commits are fast because they happen locally. When the commit is complete, you can keep working, and all your files are pushed to GitHub in the background.
You should use file locking on binary files, prefabs, and Unity scenes, because if you make a lot of edits to these types of assets, it can sometimes be difficult to merge and resolve conflicts.
A good approach to developing games in Unity is to split your work into prefabs to avoid conflicts, along with a proper folder structure and naming convention to avoid renaming as much as possible.
Keep it to a minimum. The basics should be a development branch and a release branch. Work on development, and merge to your release branch from time to time. If you want to dig deeper, take a look at the concept of "trunk based development", which explains a proper branching strategy for game development. A practice where you work on the main branch, but create short feature branches that merge back into the main branch every day.
When using Anchorpoint, you normally don’t need to deal with these things, but if you use another desktop application such as SourceTree or GitHub desktop, you have to make sure that:
Once your team members are invited by you, they simply need to accept the invite and create a GitHub account. That’s all on GitHub.
Your team members will also receive an invite email from Anchorpoint. They have to download and install the application as well as create an account. Once they open Anchorpoint, they first have to accept the invite, and the corresponding project will open automatically.
After clicking on Join Git Repository, Anchorpoint will ask for the place where the files should be downloaded. In some cases, a popup appears that requires to install Git first, before Anchorpoint can proceed with the download.
During the download process, a popup from GitHub will also appear, where your member has to authenticate to GitHub so that Anchorpoint can download the files.
When working with Git using Anchorpoint, it is basically a two-button solution. The process is as follows:
This workflow is like a file sync with more control. The recommendation is to push changes pretty often so that your team is in sync. It’s about developing a good habit of commenting on pieces of your work so that your whole project process is more transparent.
Anchorpoint has several options for restoring, reverting to previous versions of files in your repository, and even restoring the project to a specific commit state.
You can undo all file changes from a commit if you didn't change any files. You can revert files to the last state saved in the repository, or even revert the entire project back to a specific commit.
GitHub has some limitations when it comes to storage that can be an issue for game development. If you reach these limitations, a push will be rejected in Anchorpoint and you will get an error message. If these are an issue for your project, you may want to look to other solutions such as Azure DevOps or self-host your Git server using Gitea.
The free version of GitHub limits file sizes up to 2GB. If you are on a paid plan, this limitation increases to 4GB.
On the free plan, you have 1GB of free storage in your repository. If you need more, you need to buy LFS storage packs.
Continuous integration and continuous deployment (CI/CD) are DevOps practices that help teams efficiently develop and release high-quality software. Within the Unity environment, CI/CD can automate various tasks, such as running tests across multiple builds or deploying to multiple platforms with a single action.
Implementing a simple pipeline can help identify bugs early in development and automatically generate and deploy builds for team leads to review and QA to test, whether on every commit, daily, or weekly. This streamlines production, minimizes overhead for team members, and allows them to focus on their core tasks, such as coding, art, or design. Read our guide on setting up a CI/CD build pipeline for Unity using GitHub Actions to learn more.
As of today, there are three solutions worth mentioning when it comes to Unity projects.
Unity acquired Plastic SCM in 2021 after Unity Collaborate was discontinued. Unity version control is nicely integrated into the editor.
Perforce is an enterprise-grade version control solution used primarily by AAA game studios. It's known for its great scalability.
Both get the job done when it comes to game development, and as a true version control solution they are much more powerful than Dropbox. Git does better in terms of branching and feature richness due to it’s popularity in the software development world. Perforce is better in terms of access control and scaling on TB sized projects.
SVN (also known as subversion) is a centralized version control solution similar to Perforce.
Unity Collaborate was Unity's own attempt to create a very simple version control solution. Unfortunately, this project has been discontinued and is no longer an option for us.
Git is a version control solution that was developed for building the Linux kernel and was initially released in 2005. Git is a decentralized version control system. This means that you have a copy of the whole repository on your computer. A repository is basically your Unity project folder on a remote server, e.g., GitHub.
The benefit of working decentralized means that you can fully work offline, you have an automated backup system, and file operations are way faster because you don’t need to wait for a server. To sync with your team, you push (upload) your files to the remote repository, and you pull (download) new file changes from the repository to your local computer. These steps are done manually, in contrast to Dropbox, which is syncing files instantly.
Git was made to deal with code, which is basically a bunch of text files. Games require a lot of binary files like 3D models, textures, sound files, etc. To keep the efficiency and to not download the whole history of your 3D models and textures, Git introduced an add-on in 2014 called Git LFS (Large File Storage). This add-on is now part of almost every Git product and service out there.
It helps to deal with binary files by storing them in a separate location on the remote server and replacing the original file with a 1kb sized pointer. This pointer only knows where the original file is so it can be downloaded to your local computer on demand. This allows you to save storage space.
When you decide on a Git hosting provider (GitHub, GitLab, Bitbucket, or Azure DevOps), you have to look at their Git LFS costs.
Unity produces a lot of overhead of files that store caches, build data, or anything else that you don’t want to upload to the Git repository. It will just take away space and slow down your push and pull procedures.
A .gitignore file is basically a filter that tells Git which files, file types, and folders should never be committed to the Git version history. Here is an example gitignore for Unity.
When a project becomes more complex or the team gets bigger, friction arises. Work in progress commits from e.g. developers can disturb the work of the artist. To prevent this, you can split the project into certain zones. Each zone can then be used by a developer or artist without getting in each other’s way. When the work is finished, these zones are dissolved and merged into the project. Git calls such things branches. A short video in our documentation explains them pretty well.
The recommendation is to keep the number of branches very small. The reason is, when you work on your own branch for a long time, you may never run into conflicts. But, once you merge that branch to the main line (imagine this like a giant commit), all conflicts that you ignored have to be solved now. It’s better to run into conflicts early and solve them quickly by working only on one branch.
If you need branches, Anchorpoint allows you to create and switch them in the dropdown in the Timeline next to the Pull button.
GitHub can work great if your project size is pretty small. As soon as you are in the double-digit gigabyte range, it’s smarter to pick another Git hosting provider such as Azure DevOps or self-host your Git server. We made a comparison in 2022 so you don’t need to spend so much time on research.