Maintaining and synchronizing a mirror remote Git repository

You could maintain a second bare repo anywhere you want (like an usb disk), and push automatically on both remotes at once.
See “pull/push from multiple remote locations“.

That or you can setup a script which does a backup, which is called in Git a bundle.
I have written recently a script which does:

You can run that script at any time: if no new commits have been created, it won’t do anything.

The idea behind bundles is to save a repo as one file (much safer than saving a large number of files in a .git tree, and easier to copy around).

Leave a Comment