Skip to content

Instantly share code, notes, and snippets.

@jeanpimentel
Created April 23, 2012 13:15
Show Gist options
  • Save jeanpimentel/2470856 to your computer and use it in GitHub Desktop.
Save jeanpimentel/2470856 to your computer and use it in GitHub Desktop.
curl -L git.io/github.sh | bash
#!/bin/bash
BASE_DIR="$(pwd)";
OWNER="${1}";
if [ "${OWNER}" == "" ];
then
OWNER=${USER}
fi;
curl -L "https://api.github.com/users/${OWNER}/repos" | grep '"name"' | cut -d \" -f 4 | while read repository;
do
directory="${OWNER}/${repository}";
echo -e "\033[32mWorking on ${directory}\033[0m";
if [ ! -d "${BASE_DIR}/${directory}" ];
then
mkdir -p "${BASE_DIR}/${directory}"
git clone "git@github.com:${directory}.git" "${BASE_DIR}/${directory}";
fi;
cd "${BASE_DIR}/${directory}";
git pull
git status -s
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment