News for hackers. Stuff that matters.
Re:The Future of Large Files in Git Is Git by tombert on Friday August 15, 2025 @06:08PM (#44917823)
Is Git ever going to get proper support for binary files?

I’ve never used it for anything serious but my understanding is that Mercurial handles binary files better? Like it supports binary diffs if I understand correctly.

Any reason Git couldn’t get that?

Re:The Future of Large Files in Git Is Git by firesteelrain on Friday August 15, 2025 @07:50PM (#44918584)
A lot of people use Perforce Helix and others use Plastic SCM. That’s been my experience for like large binary assets with git-like functionality
Re:The Future of Large Files in Git Is Git by tom_ on Friday August 15, 2025 @09:32PM (#44919248)
I didn't enjoy using Plastic, but Perforce is ok (not to say that it's perfect - I miss a lot of git stuff). It does have no problems with lots of data though! This article moans about the overhead of a 25 MB png file... it's been a long time since i worked on a serious project where the head revision is less than 25 GB. Typical daily churn would be 2.5 GB+.

(It's been even longer since i used svn in anger, but maybe it could work too. It has file locking, and local storage cost is proportional to size of head revision. It was manageable enough with a 2 GB head revision. Metadata access speed was always terrible though, which was tedious.)

Re:The Future of Large Files in Git Is Git by firesteelrain on Friday August 15, 2025 @09:50PM (#44919366)
SVN should be able to handle large files no issue imho
Re:The Future of Large Files in Git Is Git by ks2048 on Friday August 15, 2025 @06:33PM (#44918057)
I'm not sure binary diffs are the problem - e.g. for storing images or MP3s, binary diffs are usually worse than nothing.
Re:The Future of Large Files in Git Is Git by digikata on Friday August 15, 2025 @06:52PM (#44918192)
I would think that git would need a parallel storage scheme for binaries. Something that does binary chunking and deduplication between revisions, but keeps the same merkle referencing scheme as everything else.
Re:The Future of Large Files in Git Is Git by tempay on Friday August 15, 2025 @06:55PM (#44918223)
> binary chunking and deduplication

Are there many binaries that people would store in git where this would actually help? I assume most files end up with compression or some other form of randomization between revisions making deduplication futile.

Re:The Future of Large Files in Git Is Git by digikata on Friday August 15, 2025 @07:18PM (#44918380)
I don't know, it's all probability in the dataset that makes one optimization strategy better over another. Git annex iirc does file level dedupe. That would take care of most of the problem if you're storing binaries that are compressed or encrypted. It's a lot of work to go beyond that, and probably one reason no one has bothered with git yet. But borg and restic both do chunked dedupe I think.
Re:The Future of Large Files in Git Is Git by hinkley on Friday August 15, 2025 @07:11PM (#44918327)
It would likely require more tooling.
Re:The Future of Large Files in Git Is Git by adastra22 on Friday August 15, 2025 @08:29PM (#44918816)
A lot in the game and visual art industries.
Re:The Future of Large Files in Git Is Git by zigzag312 on Saturday August 16, 2025 @05:42AM (#44921786)
2-3x reduction in repository size compared to Git LFS in this test:

https://xethub.com/blog/benchmarking-the-modern-development-...

Re:The Future of Large Files in Git Is Git by zigzag312 on Saturday August 16, 2025 @05:26AM (#44921697)
Xet uses block level deduplication.
Re:The Future of Large Files in Git Is Git by zigzag312 on Saturday August 16, 2025 @08:09AM (#44922547)
> for storing images or MP3s, binary diffs are usually worse than nothing

Editing the ID3 tag of an MP3 file or changing the rating metadata of an image will give a big advantage to block level deduplication. Only a few such cases are needed to more than compensate for that worse than nothing inefficiencies of binary diffs.

Re:The Future of Large Files in Git Is Git by brucehoult on Friday August 15, 2025 @10:04PM (#44919465)
All files in git are binary files.

All deltas between versions are binary diffs.

Git has always handled large (including large binary) files just fine.

What it doesn't like is files where a conceptually minor change changes the entire file, for example compressed or encrypted files.

The only somewhat valid complaint is that if someone once committed a large file and then it was later deleted (maybe minutes later, maybe years later) then it is in the repo and in everyone's checkouts forever. Which applies equally to small and to large files, but large ones have more impact.

That's the whole point of a version control system. To preserve the history, allowing earlier versions to be recreated.

The better solution would be to have better review of changes pushed to the master repo, including having unreviewed changes in separate, potentially sacrificial, repos until approved.

Re:The Future of Large Files in Git Is Git by afiori on Saturday August 16, 2025 @03:54AM (#44921219)
My understanding is that git diff algorithms require a file to be segmentable (eg text files are split line-wise) and there is no general segmentation strategy for binary blobs.

But a good segmentation is only good for better compression and nicer diff, git could do byte wise diffs with no issues, so I wonder why doesn't git use customizable segmentation strategies where it calls external tools based on file type (eg a rust thingy for rust file etc, or a PNG thingy for PNG files).

At worst the tool would return either a single segment for the entire file or the byte wise split which would work anyway

Re:The Future of Large Files in Git Is Git by joeyh on Saturday August 16, 2025 @09:02AM (#44923021)
A common misconception. git has always used binary deltas for pack files. Consider that git tree objects are themselves not text files, and git needs efficiently store slightly modified versions of the same tree.
Re:The Future of Large Files in Git Is Git by afiori on Monday August 18, 2025 @03:10AM (#44938153)
so are pack files diffed byte-wise?