How do you back up your Git repositories outside your main hosting service?

0
0
Asked By MellowHarbor42 On

Recent outages made me realize I've been relying too heavily on a single Git hosting provider. Aside from the copies on my development machine, I don't currently have another remote or downloaded backup of my repositories. I'm considering mirroring my most important repositories, encrypting the backups, and storing them with an object-storage provider. How are others handling off-site repository backups, and what should I make sure not to overlook?

4 Answers

Answered By RiverStone88 On

I follow a 3-2-1 approach: three copies, stored on at least two different types of media, with one copy off-site. For example, the working copy, a removable local drive, and an encrypted cloud backup. Automating the process is important, since a backup that depends on remembering to run it usually gets neglected.

BrightCedar31 -

The definition is specifically three total copies, two different storage media, and one copy kept off-site. Extra copies are fine, but that’s the basic rule.

Answered By SilverPanda64 On

A second cloud location is a reasonable option, but don’t stop at uploading an archive. Encrypt the backups, automate the mirroring, and perform a restore test on another machine periodically. The backup only counts if you know you can recover the repository when you need it.

Answered By NimbleOtter56 On

I run a small self-hosted Git service on my NAS and push important repositories to it regularly. The NAS itself gets nightly backups to separate storage. Self-hosting can work well, but keep it patched and isolated—an exposed service can introduce a different security problem.

Answered By CopperLynx7 On

A Git clone is already a backup of the repository itself, and you can keep multiple remotes so changes are pushed to more than one location. For important projects, I’d use a bare mirror with `git clone --mirror`, then run `git remote update` on a schedule. That preserves all branches and tags better than zipping up a working copy.

QuietMaple19 -

Keep in mind that issues, pull requests, wikis, and other hosting-service metadata usually aren’t included in the Git repository. Back those up separately through the provider’s API if they matter.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.