Can Git treat ZIP files as directories and files inside the ZIP as blobs?

This doesn’t exist, but it could easily exist in the current framework. Just as Git acts differently with displaying binary or ASCII files when performing a diff, it could be told to offer special treatment to certain file types through the configuration interface.

If you don’t want to change the code base (although this is kind of a cool idea you’ve got), you could also script it for yourself by using pre-commit and post-checkout hooks to unzip and store the files, then return them to their .zip state on checkout. You would have to restrict actions to only those files blobs / indexes that are specified by git add.

Either way is a bit of work — it’s just a question of whether the other Git commands are aware of what’s going on and play nicely.

Leave a Comment