1

I use a central git server (a gitlab instance). Developers clone projects to a samba share on another server. At the moment, I make backups of the gitlab server and all of the developers directorys on the other server. This costs a lot of disk space. Ideally, I would like to only backup the gitlab server. I can't do that because changes not yet pushed to it could be lost (and I cannot shift responsibility for backups to the developers, e.g. forcing them to push everything once a day). Is there a solution to deduplicate this data with git? I'm not sure if using another deduplication system before the actual backup would work as I think even small changes in a repo could be big for another system when git packfiles change.

2
  • Which backup software are you currently using? I believe a number of the heavy-weight ones supports at least file level de-duplication, so the only files that would be duplicated are ones that have current edits in them (but the entire repositories wouldn't take up much additional space). Feb 17, 2013 at 1:54
  • I use bacula. What I'm worried about are the garbage collected blobs. When all the blobs are packed together in packfiles and you add/change something, the packfiles will change, right? So from the outside (of git) it will seems as a big file that changed so it's backed up completely. Feb 17, 2013 at 16:17

1 Answer 1

0

Depends on how you back up. If you use git for backing up, then it's easy: add a remote for each of the developers' repos and git fetch them all. Git then does the deduplication for you by storing each object only once, no matter how many remotes have it.

6
  • Great, now how do you do a restore? Feb 16, 2013 at 19:44
  • All the refs (branches) are there, so you simply clone the backup and check out your branches. Feb 16, 2013 at 19:50
  • 2
    I just don't consider any backup strategy complete without a restore strategy - and tests. :) Feb 16, 2013 at 19:51
  • Very good point! Feb 16, 2013 at 19:54
  • This might be a good idea. I will need to write some scripts to detect new projects etc. but I think that might work. Thank you. Feb 17, 2013 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .