Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save galexrt/6be0ef8bf6e0bd5e037db29d6cbdfe4e to your computer and use it in GitHub Desktop.
Save galexrt/6be0ef8bf6e0bd5e037db29d6cbdfe4e to your computer and use it in GitHub Desktop.
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