Skip to content

Instantly share code, notes, and snippets.

@Daniel-M
Created March 16, 2017 05:00
Show Gist options
  • Save Daniel-M/91ae247a21e0d861251242893cb9c3be to your computer and use it in GitHub Desktop.
Save Daniel-M/91ae247a21e0d861251242893cb9c3be to your computer and use it in GitHub Desktop.
Clone all user repositories at github using the simple autentication method with the github API. User needs to be authenticated
#!/bin/bash
username="" # The user to be autenticated
script="clone_github_"$username"_repos.sh"
curl -i -u $username https://api.github.com/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