批量备份git库的脚本
枚举型备份
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #!/bin/bash function update_repo() { local REPO_NAME=$1 echo "--- --- --- --- " echo "--- --- REPO : "$REPO_NAME " --- --- " if [ -d $REPO_NAME".git" ]; then cd $REPO_NAME".git" git fetch --all cd .. else git clone --bare ssh://your-name@192.168.0.1:22/$REPO_NAME fi } update_repo project-01 update_repo project-02 update_repo project-03 |