Skip to content

Instantly share code, notes, and snippets.

@ohrafaelmartins
Created April 22, 2024 17:22
Show Gist options
  • Save ohrafaelmartins/5f0a3706a8ad2b464c511d7b416d22db to your computer and use it in GitHub Desktop.
Save ohrafaelmartins/5f0a3706a8ad2b464c511d7b416d22db to your computer and use it in GitHub Desktop.
To clone every repository in your organization, you can use a simple script or command-line tool. Here's a step-by-step guide to achieving this using the GitHub API and some scripting:
#!/bin/bash
# To clone every repository in your organization, you can use a simple script or command-line tool.
# Here's a step-by-step guide to achieving this using the GitHub API and some scripting:
# Set your GitHub username and Personal Access Token
USERNAME="USERNAME"
TOKEN="TOKEN"
# Replace with your organization name
ORG="ORG"
REPOS=$(curl -s "https://api.github.com/orgs/$ORG/repos" | jq -r '.[].ssh_url')
# Clone each repository using SSH
for REPO in $REPOS; do
git clone $REPO
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment