Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Clone all public GitHub repositories
- # source: https://twitter.com/MaximeEuziere/status/914795875997769731
- # Thanks xem (@MaximeEuziere)!
- #
- # Note: only 100 repos can be queried at once, check "page" parameter.
- curl "https://api.github.com/users/<USERNAME>/repos?page=1&per_page=100" | grep -e 'git_url*' | cut -d \" -f 4 | xargs -L1 git clone
- ### Clone all GitHub repositories, including private ones.
- # This needs an access token (that can also be used as a password when cloning), how to get one:
- # 1. Go to https://github.com/settings/tokens
- # 2. Click "Generate new token"
- # 3. Add some description, check "repo" scope, click "Generate token"
- # 4. Copy the token in the green line beside the tick mark
- #
- # Note: this way the token gets a lot of unneeded privileges (ex. write to private repos) but it cannot be refined, see
- # https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/
- #
- # Note: only 100 repos can be queried at once, check "page" parameter.
- wget -O - "https://api.github.com/user/repos?access_token=<TOKEN>&page=1&per_page=100" | grep -e "clone_url*" | cut -d \" -f 4 | sed -r "s,https://,https://<USERNAME>:<TOKEN>@," | xargs -L1 git clone
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement