Skip to content

Instantly share code, notes, and snippets.

@xddq
xddq / download-repos.sh
Last active August 23, 2020 00:56
automaticly download all public and private repos of a user using the github api(v3) under linux
#!/bin/sh
# Just replace USERNAME and TOKENVALUE with your username and personal access
# token value(make sure you set it up with "full control of private repository"
# checked. Obviously you need to have set up a ssh key for your account as well.
curl -u USERNAME:TOKENVALUE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/repos | grep git_url | sed -E sQ.*.com\/\|\",QQg \
| xargs -I% git clone git@github.com:%