Created
December 17, 2018 23:19
-
-
Save pirafrank/0be58762445c10b8d377c7d97985b034 to your computer and use it in GitHub Desktop.
mirror your git repos to make a backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for url in $(ssh git.example.com ls-urls) | |
do | |
echo "Cloning $url ..." | |
git clone --mirror "$url" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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