Godot Version
4.x
Question
What are the best practices for setting up Git LFS for your Godot project’s repository? More specifically, what exactly should the LFS be tracking?
TL;DR below, but would appreciate reading the whole post to understand my thought process. :>
So far I have seen two ways of tracking your binary files.
A: Creating an assets folder which contains all your binaries and then tracking this directory as a whole.
B: Adding each and every binary file extention to the .gitattributes
file from .png
, .mp3
, .fbx
all the way to Godot’s own binaries like .scn
and .res
similar to this post.
Both options have their own advantages and disadvantages.
If you have a well organized project structure, then option A is a simple way of tracking all large files by just adding one directory to the .gitattributes
file. However, files like .scn
and .res
are not going to be tracked if they are saved in a different folder just for resources.
Option B on the other hand allows a more precice tracking regardless of where files are saved within the project structure. You just have to remember to add all the necessary file extentions to your .gitattribute
file and not forget in case you some day, for some reason, do end up having to make an obscure file like .multimesh
. XD
Also what about some text-based assets?
Like the .import
files that Godot generates with every imported asset. Using option A means that those will be tracked too. They are text-based so technically they don’t need to be tracked. But on the other hand, they are closely linked to the assets they belong to. And it’s not like you edit those a whole bunch either. So should they be tracked as well?
And what about .svg
files. While being images, they are text-based as well. So same could be said about them too: They aren’t edited much; might as well track them too, right?
Thank you for reading!
Maybe I’m being a little too overcautious with this, but I just wanna set up my LFS the right way in order to avoid problems with it later.
Let me know how you set up Git LFS for your larger projects. If you use Git at all that is, considering it’s not the greatest for game projects.
TL;DR
Track the entire assets folder or pick out file extentions individually?
Also, .import
files: Track them or not?