Skip to content

Instantly share code, notes, and snippets.

@dkgndianko
Last active May 16, 2023 13:55
Show Gist options
  • Save dkgndianko/5851d7aec6a618baf8e8eebbefc6eed2 to your computer and use it in GitHub Desktop.
Save dkgndianko/5851d7aec6a618baf8e8eebbefc6eed2 to your computer and use it in GitHub Desktop.
Clone all repositories belonging to a given org or user at Github. You must install `gh` command (`brew install gh` under mac) and be authenticated (`gh auth login`).
org=myorg_is_here
gh repo list $org --limit 100 | cut -f 1 | xargs -L1 gh repo clone $1
@dflima
Copy link

dflima commented May 16, 2023

But for the gh auth login, how do someone authenticate?

One way is you can create a personal access token on github, and then save it as an environment variable GITHUB_TOKEN on your computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment