Note that there are some explanatory texts on larger screens.

plurals
  1. POCan git treat zip files as directories and files inside the zip as blobs?
    primarykey
    data
    text
    <p><strong>The scenario</strong></p> <p>Imagine I am forced to work with some of my files always stored inside <code>.zip</code> files. Some of the files inside the zip are small text files and change often, while others are larger but luckily rather static (e.g. images).</p> <p>If I want to place these zip files inside a <code>git</code> repository, each zip is treated as a blob, so whenever I commit the repository grows by the size of the zip file... even if only one small text file inside changed!</p> <p><strong>Why this is realistic</strong></p> <p>MS Word 2007/2010 <code>.docx</code> and Excel <code>.xlsx</code> files are ZIP files...</p> <p><strong>What I want</strong></p> <p>Is there, by any chance, a way to tell <code>git</code> to not treat zips as files, but rather as directories and treat their contents as files?</p> <p><strong>The advantages</strong></p> <ul> <li>much smaller repo size, i.e. quicker transfer/backup</li> <li><a href="https://stackoverflow.com/questions/4704873/display-changes-with-git-to-zips">Display changes with Git to zip's</a> would automagically work</li> </ul> <p><em>But it couldn't work, you say?</em></p> <p>I realize that without extra metadata this would lead to some amount of ambiguity: on a <code>git checkout</code> git would have to decide whether to create <code>foo.zip/bar.txt</code> as a file in a regular directory or a zip file. However this could be solved through config options, I would think.</p> <p><strong>Two ideas how it could be done</strong> (if it doesn't exist yet)</p> <ul> <li>using a library such as <code>minizip</code> or <code>IO::Compress::Zip</code> inside git</li> <li>somehow adding a filesystem layer such that git actually sees zip files as directories to start with</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload