Re:We Put Half a Million Files in One Git Repository, Here's...
by IshKebab on Monday August 28, 2023 @12:11PM
(#37296368)
It's not an unbreakable rule that generated or binary files should not be in Git. It's a rough guideline. Partly because Git is bad at dealing with binary files.
There are plenty of cases when including generated files is appropriate. It has many advantages over not doing that - probably the biggest are
* Code review is much easier because you can see the effect on the output.
* It's easier to find the generated files because they're next to the rest of your code. IDEs like it much more too.
In fact the upsides are so great and the downsides so minimal I would say it should be the default option as long as:
* The generated files are not huge.
* The generated files are always the same.
Even when they are huge it might still be a good idea, but you can put the files in a submodule or LFS. I do that for a project that has a really difficult to install generator so users don't need to install it.
There are plenty of cases when including generated files is appropriate. It has many advantages over not doing that - probably the biggest are
* Code review is much easier because you can see the effect on the output.
* It's easier to find the generated files because they're next to the rest of your code. IDEs like it much more too.
In fact the upsides are so great and the downsides so minimal I would say it should be the default option as long as:
* The generated files are not huge.
* The generated files are always the same.
Even when they are huge it might still be a good idea, but you can put the files in a submodule or LFS. I do that for a project that has a really difficult to install generator so users don't need to install it.