git repo backup - 02-23-20

Backup a git repo without thats not hosted on remote repo with:

$ git bundle create /tmp/pass_"$(date +%s)".bundle --all

Then to confirm bundle:

$ git bundle verify /tmp/pass_1582448923.bundle

When you need to restore the backup into a new repo folder:

$ git clone -b master /tmp/pass_1582448923.bundle newrepo

I recently used this to backup my ~/.pass-store pass repo. Basically it’s a folder full of .gpg files each encrypting a password. Don’t want to store it on a remote host so I back it up locally. Create a git bundle then I encrypt the resulting bundle file and store it somewhere safe.

$ gpg --symmetric ./pass_1582448923.bundle


git-memo docs

\- [ git, pass ]