How to use version control for GameMaker with GitHub
Learn how to back up your files and to collaborate in a team using Git as a version control solution on your GameMaker project.
In this tutorial, we will setup GitHub for a Godot project using Godot 4.2. We will use Anchorpoint as a Git client to push and pull our files to GitHub. All of this works with the free version of Anchorpoint.
Version control is a cornerstone of your workflow with Godot or any other game engine. Game engines do not understand incremental saving and you don’t want to copy and paste your “backup files” on your desktop. Version control solves that problem and allows you:
Git is a version control systems. Alternative solutions to Git are Perforce, Unity Version Control or SVN. Git is free and open source and has a huge ecosystem of cloud providers, applications and knowledge. GitHub is a cloud provider, that is based on Git. You can even download the Godot source code from there. GitHub will act like a “Dropbox alternative” where you will push and pull files.
If you want to work purely offline, of course you don’t need GitHub. But everywhere on the internet, people will recommend it’s usage for solo developers as well, because you have a free backup solution.
You don’t need it. You can also use the Git command line, if you like that or a Godot Git plugin. Anchorpoint acts like a Git client such as SourceTree or GitKraken. Anchorpoint is made for non coders, while the others are mostly made for developers. The benefit of using such an application is that you have a better overview of your history and if you incorporate your art files (Blender, Photoshop etc.) you can also version them with Git. So you have a unified clean workflow.
The whole setup requires just 3 minutes. We will use the GitHub integration in Anchorpoint, so that we can create repositories directly from it, which is faster than doing this on GitHub.
For the first time, we need to commit all of our files to GitHub. “Commit” means just to create a version that we can go back later on. It’s like creating a checkpoint of your project. In Anchorpoint you will sync the files, which is a combination of a commit and a push to GitHub.
Now, make a change in Godot by e.g. adding a comment to your code or by adding a new asset.
There is no hard rule when you should commit your work. The recommendation is when you made a meaningful change to your project. E.g., you implemented a new input system or your made a significant update to that input system. Once you are done, commit that as a new version.
You should at least commit your files when you finish your daily work.
As of today, you can have 1GB of storage in the free tier. If you need more, you can buy storage packs. If you think, that you need a lot of storage (more than 150GB) then it makes sense to switch to Azure DevOps, because as of today, there are no storage limitations.
A .gitignore file is a central component for managing your Godot projects using Git. It is a set of rules that tells Git which files to exclude from version control. When you adjust the version control settings in Godot, it will automatically create the .gitignore file. Each game engine such as Unity and Unreal have different .gitignore settings.
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 introduces 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. With Anchorpoint, you don’t encounter any Git LFS related commands, because that happens in the background. If you use other clients, you will need to configure Git LFS at the beginning of your project.