Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Daniel-M/aed1edd316434612c589a178673d20a5 to your computer and use it in GitHub Desktop.
Save Daniel-M/aed1edd316434612c589a178673d20a5 to your computer and use it in GitHub Desktop.
Generates a script to clone all the public repositories from a given user
user=""
script="clone_github_"$user"_public_repos.sh"
curl -i https://api.github.com/users/$user/repos | awk 'index($line,"ssh_url") { print $line}' | sed '{s/"//g;s/,$//g;s/ *ssh_url\:/git clone/}' > $script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment