I think it’s generally agreed upon that large files that change often do not belong while small files that never change are fine. But there’s still a lot of middle ground where the answer is not so clear to me.

So what’s your stance on this? Where do you draw the line?

  • borf@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    0
    arrow-down
    1
    ·
    2 months ago

    hiss The point of source control is keeping a history of the code that produces binary artifacts. For convenience’ sake or because of some wild project-specific constraints people can do all kinds of things but IMO binaries in source control are yucky yucky bad bad bad.

    • Limonene@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      I agree that the repository should only contain source files, not the output of the build process. However, in some cases (like icon images) the source files may be binary. I think small binaries that are required to build and/or run the software, and that are not an output of any build process, do make sense to put in the repository.

  • Lodra@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    arrow-down
    1
    ·
    2 months ago

    Never do this.

    Git is all about tracking changes over time which is meaningless with binary files. They are bloat for your repo, slowing down operations. Depending on the repo, they are likely to change from CI with every commit. That last one means that every commit turns into 2 commits btw. They are can ruin diffs. I could go on for a long time here.

    There are basically 0 upsides. Use an artifact repository instead!

    • FizzyOrange@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 months ago

      Git is all about tracking changes over time which is meaningless with binary files.

      Utter codswallop. You can see the changes to a PNG over time. Lots of different UIs will even show you diffs for images.

      Git can track changes to binary files perfectly well. It might not be great at dealing with conflicts in them but that’s another matter.

      The only issue is that binary files tend to be large, and often don’t compress very well with Git’s delta compression. It’s large files that are the issue, not binary files. If you have a 20 kB binary file it’s going to be absolutely fine in Git. Likewise a 10 GB CSV file is not going to be such a good idea.