cd /backup/destination git init --bare myproject.git
cd /myproject git push --all --force /backup/destination/myproject.git
# assuming you have a mount point at /gitshare echo -e "backing up repo...\n"; git push --all --force /backup/destination/myproject.git
cd /backup/destination git clone --no-hardlinks --mirror /path/to/myproject backupfoldername
cd /backup/destination/backupfoldername git fetch
cd /path/to/your/usb/drive/destfolder git clone --mirror /project.git
#!/bin/sh `which ls` -1d *.git | while read item;do echo -e "updating ${item}...\n" cd "${item}" git fetch --all --force cd .. done