Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
mirror your git repos to make a backup
#!/bin/bash
for url in $(ssh git.example.com ls-urls)
do
echo "Cloning $url ..."
git clone --mirror "$url"
done
#!/bin/sh
# place this file into /home/git/git-shell-commands/ls-urls
baseurl="git@git.example.com:/home/git/repos/"
ls -A1 /home/git/repos | xargs -I {} echo "$baseurl"{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.