Skip to content

Instantly share code, notes, and snippets.

@sandrokeil
Last active April 8, 2017 23:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandrokeil/450a5e5cf1b3bdfa23b9 to your computer and use it in GitHub Desktop.
Save sandrokeil/450a5e5cf1b3bdfa23b9 to your computer and use it in GitHub Desktop.
git-batch-clone
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "First parameter is a file with a list of repos and second parameter is the git path e.g. git-batch-clone repos.txt git@github.com:sandrokeil/"
fi
cd $(pwd)
cat $1 | while read line
do
if [ ! -d "$line" ]; then
echo -e "\e[32mCloning $line\e[0m"
git clone $2$line
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment