2

Can git generate a linear delta history during garbage collection?

In a previous question I learned that, during garbage collection, git repacks and stores deltas instead of the full revisions it had before gc. I used this to my advantage to store a mysqldump as a backup and for free I get history and data compression.

My problem now is, now that there's a lot of history (once a day, for a few months), every time it does git gc git will rewrite the entire delta history (changing all data on the file system), and that makes offsite syncs transfer all that data. I wish my rsyncs would just have to transfer the new deltas.

Put another way, is there a way to get git to only repack what hasn't already been packed?

Community
  • 1
  • 1
Shovas
  • 215
  • 1
  • 9
  • 1
    You could use git to transfer the files instead of rsync - it's designed to do *exactly this* after all. – Edward Thomson Nov 07 '15 at 20:10
  • Hm that's a solution but I hate to add additional steps beyond rsync to transfer backups. I just wish it could all work. Maybe I should just use another rcs. – Shovas Nov 26 '15 at 17:32

1 Answers1

0

The requested functionality:

... is there a way to get git to only repack what hasn't already been packed?

Exactly matches what git repack does. From the git-repack reference:

This command is used to combine all objects that do not currently reside in a "pack", into a pack.

Run without any options it will pack any loose (unpacked) objects but leave them on disk. This can be changed with the -d option:

After packing, if the newly created packs make some existing packs redundant, remove the redundant packs. Also run git prune-packed to remove redundant loose object files.

Alternatively git prune-packed can be run manually.

mmlr
  • 1,895
  • 11
  • 17