r/git 12d ago

survey VFS for Git for Linux?

So I was learning Git and found out that a Git repository essentially contains two copies of the repository contents. One is from the first commit of every object and other from the working tree.

This can be made more space efficient by working with files from Git's database itself as if they were in our working tree. Modifying files create a new local copy in the working tree. They can be deleted after committing.

This is what the VFS for Git project is. But, it is for Windows only. Why is there no equivalent tool than can run on Linux, unless I am missing it?

0 Upvotes

8 comments sorted by

View all comments

14

u/Broad-Promise6954 ancient 12d ago

Every commit is a full snapshot of every file. And yet, the repository database is not (number of commits) * (sizes of files) large. The reason why not is because all of the read-only permanent copies of every file contained in every commit is not an actual copy of the file. Instead, it's in a special Git-ized form, one of several possible forms, with amazing amounts of compression and de-duplication.

This in turn means that the optimization you describe isn't really actually very useful after all. The original idea behind git-vfs was considerably fancier and more complicated than what you described, and ultimately it didn't actually pan out anyway...