Skip to content

Instantly share code, notes, and snippets.

@codeck
Created October 29, 2013 02:57
Show Gist options
  • Save codeck/7208519 to your computer and use it in GitHub Desktop.
Save codeck/7208519 to your computer and use it in GitHub Desktop.
#!/bin/sh
GITHOST=scm@192.168.100.221
GITPATH=gitroot
cd ~/${GITPATH}_backup
ls -F . | grep / > /tmp/.gitmissing1
eval ssh -n $GITHOST ls -F ${GITPATH}/. | grep / > /tmp/.gitmissing2
diff /tmp/.gitmissing1 /tmp/.gitmissing2 | egrep '^>' |
while read x f; do
git clone --bare --mirror ${GITHOST}:${GITPATH}/$f $f
done
rm -f /tmp/.gitmissing1 /tmp/.gitmissing2
for f in */.; do (cd $f; echo $f; git fetch); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment