Reputation: 2714
I have about 20 or so git repositories on my local drive that I want to backup to my external hard drive. I use FreeFileSync to mirror my local drive on the external. I don't want to just copy my git repo over there, since any changes to the local files will be confusing for the mirroring software.
From what I have read, there are a few options (git bundle, zipping, cloning a bare repo) but I'm not sure what the best method would be for my case. When I plug in my external and get it to do a backup, is there a simple script that can grab all my repos, zip or bundle them, and then move them to the external drive?
Looking for general advice.
Upvotes: 2
Views: 410
Reputation: 1326776
git bundle is the recommended method if you understand that it would not include untracked or work in progress files (only existing commits).
Plus it supports incremental backups.
zip is the recommended medthod if you want to grab everything.
In that regard, a simple script would be one zipping one folder (which would then includes all your Git repositories), assuming your repos are not too big.
You could configure your USB Key to "autorun" a program doing just that.
Upvotes: 2