简体   繁体   中英

Multiple git packfiles

I would like to know if it is possible to have more than one pack file (and index) for the same repository. Some kind of accumulative pack file that just contains the differences since the last push for instance.

I'm seeing this in a custom implementation using git and I would like to know if it is something natural to git.

Kind regards

As phd answered , Git will read multiple pack files (and pack index files). Note, however, that each pack file is required to be fully self-contained: deltified object's bases for an object inside the pack must also be inside that same pack. (For instance if the deltified representation of object 0123... says start with 4567... and make these changes , object 4567... must be in the same pack file.) This means that many small packs are likely to use more space than fewer larger packs.

Differences since the last push actually occur rather naturally, because git push over smart protocols work by having the two Gits converse to see which objects to transfer. The sender then sends a thin pack , which deliberately violates the above rule—it will contain only the deltified objects and not their bases—which the receiver must "fatten" using git index-pack --fix-thin . If the receiver does that, and leaves the fattened, no-longer-thin pack in place, the receiver now has N+1 packs where the receiver used to have N packs.

You can limit packfiles by size setting pack.packSizeLimit . Reaching this limit git creates multiple packfiles.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM