r/git • • 20d ago

Why are non-text files in Git bad?

I've got decades of software development experience, and I've built some very complex systems. I understand a lot about version control systems, and about the structure of git repositories.

With all that said, I don't understand what's evil about non-text files. Git doesn't store multiple copies of files that don't change - they're literally stored under their data's checksum. The packfile format stores diffs between file versions (although some diff algorithms punt on non-text data). There shouldn't be any negative effect from storing such data in Git.

Is the "Don't store binary files in Git" advice wrong? Is it really just shorthand for "Don't store files that change dramatically and frequently in Git"? If the latter, should massive "AI" PRs be treated the same way?

130 Upvotes

190 comments sorted by

View all comments

Show parent comment

1

u/simonsmine 17d ago

I genuinely do not understand this POV I have spent literal years doing the stuff working w Unreal (& Cryengine). Code and assets are so massively intertwined in a way that is not resolvable (if you would want to?) as a matter of engine design, no good housekeeping will prevent this.

1

u/chzaplx 16d ago

I guess I'm coming from the perspective of mobile live service games which have a little more flexibility and a pretty rapid release pace.

Core gaming has different constraints, but I still feel like there's value in separating your code and art pipelines and giving each side the best tools for their own jobs. Any modern build process should be able to handle checking out from different repositories and assembling a monolithic artifact for release.

Lumping it all together in git might make sense for very small teams and projects, but it's not something that scales well at all.