Skip to content

Instantly share code, notes, and snippets.

@SanCoder-Q
Created November 29, 2018 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SanCoder-Q/e96eb939a3bea2ceff3aeb411fcf5414 to your computer and use it in GitHub Desktop.
Save SanCoder-Q/e96eb939a3bea2ceff3aeb411fcf5414 to your computer and use it in GitHub Desktop.
Tricks using github API
git_auth_token=''
git_domain=''
org_name=''
# Clone all
curl "https://api.${git_domain}/${org_name}/<>/repos" -H "Authorization: token ${git_auth_token}" |\
jq -r .[].subscription_url |\
xargs -n1 -Ix git clone x
# Watch all
curl "https://api.${git_domain}/${org_name}/<>/repos" -H "Authorization: token ${git_auth_token}" |\
jq -r .[].subscription_url |\
xargs -n1 -I@ curl -XPUT @ -H "Authorization: token ${git_auth_token}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment