Skip to content

Instantly share code, notes, and snippets.

@audy
Last active January 12, 2016 15:30
Show Gist options
  • Save audy/f7ae8a0ae45397622945 to your computer and use it in GitHub Desktop.
Save audy/f7ae8a0ae45397622945 to your computer and use it in GitHub Desktop.
clone $user's GitHub repos
#!/bin/bash
USERNAME=`whoami`
PASSWORD=`pass github`
set -euo pipefail
REPOSITORIES=$(curl \
--user ${USERNAME}:${PASSWORD} \
--silent \
https://api.github.com/users/${USERNAME}/repos?per_page=200 \
| jq --raw-output '.[] | .git_url')
for repository in ${REPOSITORIES}; do
git clone ${repository}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment