Skip to content

Instantly share code, notes, and snippets.

@dgmike
Last active October 20, 2021 11:45
Show Gist options
  • Save dgmike/94f6a48db2855413a89d2ecbb1051246 to your computer and use it in GitHub Desktop.
Save dgmike/94f6a48db2855413a89d2ecbb1051246 to your computer and use it in GitHub Desktop.
Clone all repos from github
#!/bin/bash
# Set CNTX=users and NAME=yourusername, to download all your repositories.
# Set CNTX=orgs and NAME=yourorgname, to download all repositories of your organization.
CNTX={users|orgs} NAME={username|orgname} PAGE=1 \
curl -s "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=100" |
jq -r '.[]|.ssh_url' |
xargs -L1 -n1 -t git clone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment