Improving the Git LFS Locking API Workflow

Georgi Tsaklev
4 min readJun 20, 2021

Git is awesome. It is the version control system used by millions of people in their projects to keep them safe and maintainable. However, there are scenarios where Git doesn’t perform quite as well as some other version control systems.

Background

I recently started a masters degree in Indie Game Development and it inspired me to take a more detailed look at the usage of version control systems in game development. Comparing my everyday usage of Git for microservices with the patterns typical for game development, one major difference became obvious. Games consist predominantly of binary files such as images (sprites and textures), 3D objects and audio. Git stores each version of these files into the repository history, causing any operation to take a very long time and making the repository enormous. Additionally, merging those files is impossible, so conflicts can only be resolved by choosing one of the two edited versions and dropping all changes made in the other. The industry has chosen to use slightly different version control systems such as Perforce and Plastic SCM. However, they are expensive and difficult to pick up for small indie developers like myself. You can read more about my research in my blog.

Git LFS diagram

This is where Git Large File Storage comes into play. It is an extension to Git that uploads binary files to a separate file server and stores simple text files in the repository which point to the uploaded files. It is absolutely transparent to the users so it is a very good solution to the problem and easy to pick up as it requires little setup. However, it only solves the repository bloating problem. What about conflicts?

Git Locking API

Git LFS comes with a handy Locking API which allows users to create and manage file locks within a repository. It automatically locks files during pushing but this is not enough to solve our problem. Additionally, it does require some configuration in order to fit the desired workflow — using a git attributes file. This makes it a little more cumbersome to use, but come on, we are engineers, we can handle CLI interfaces without an issue!

When I joined the Global Game Jam earlier this year I quickly realised the main users of this API won’t be the engineers on the project. It would be the 3D and 2D artists, sound and level designers. While most people in the games industry have touched and played with all parts of the workflow they are not fully comfortable with Git’s CLI and can easily make mistakes.

Thinking that somebody must have created a nice GUI for the File Locking API I started looking around the depths of the web. I found some, however, they didn’t solve the problem all the way. Most required to be started through the CLI or to update their configuration files to switch repositories. I took this as a sign that I should contribute to the community and improve everybody’s workflow.

Git Locks Manager

Git Locks Manager Icon

The requirements are simple — the user should be able to add repositories from their machine, list the lockable files in a selected repository, lock and unlock files. As I was developing the tool I figured a couple more features would go a long way — editing the git attributes file to configure which files are lockable and configuring a custom Git LFS server.

As a starting point I used the secure-electron-template which gave me a solid foundation to build the application on. The next challenge was picking a design system. I opted for Primer, GitHub’s design system. It allowed me to create a UI similar to GitHub Desktop, making it extremely easy to pick up for non-engineer users who would be familiar with the GitHub Desktop UI.

The final product lets the user easily add new projects through the repository selector and quickly switch between them. Viewing and filtering all the lockable files in the repository is a breeze and the user can view who locked the files and when. New repositories are easy to setup as the application guides you through every step.

Git Locks Manager Screenshot

You can download and try Git Locks Manager from the latest GitHub release. It is available for Windows, MacOS and Linux. I plan to battle-test the application with fellow Indie Game Development students and continue releasing new features to help game developers thrive with Git. If you find a bug or have a suggestion open up an issue and help me make this tool the best it can be.

--

--