I have a number of git repositories which I would like to keep synchronized and backed up. By synchronized, I mean that I work off of several different computers and want to always use the latest copy. By backup, I would like to have something that I can restore from quickly (less than 5 minutes).

The options I see are:

  1. consolidate to a single repository

    not a problem now, but perhaps down the road when I want to only share a subset of code just run git push/pull once

  2. write a script to recurse into sub-directories and run git push/pull

    a bunch of git sub-modules is a pain to manage, is there any other way to do this without having to recurse through all the sub-modules.

  • Your operating system is... ? (or does it even matter?) – slhck Jul 21 '11 at 12:29

If those repos aren't too big, another solution would be to recurse into sub-directories and run git bundle --all:

You ends up with one file per repo, much easier to save/transfert.

From each bundle, you can easily pull/clone in order to restore a working Git repo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.