Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Clone all non-fork repos of a user
GITHUB_USERNAME="galexrt"
for repo in $(curl -s https://api.github.com/users/${GITHUB_USERNAME}/repos\?per_page\=200 | jq --raw-output '.[] | select(.fork != true) | .ssh_url'); do
git clone "${repo}"
done
GITHUB_USERNAME="galexrt"
curl -s https://api.github.com/users/${GITHUB_USERNAME}/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| if !repo["fork"] then %x[git clone #{repo["ssh_url"]} ]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment