Created
November 15, 2017 08:09
-
-
Save zserghei/c44b604af0b4a6eaa047faeec1ea3026 to your computer and use it in GitHub Desktop.
Git clone multiple projects
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 | |
set -e # Exit immediately if a command exits with a non-zero status. | |
for rep in \ | |
http://[email protected]/project1.git \ | |
http://[email protected]/project2.git \ | |
http://[email protected]/project3.git \ | |
; do | |
folder=`echo $rep | awk -F'/' '{print $NF}' | cut -d'.' -f1` | |
if [ ! -d $folder ]; then | |
echo " $folder" | |
git clone $rep | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment