Skip to content

Instantly share code, notes, and snippets.

@dkgndianko
Last active May 16, 2023 13:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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
@erdincay
Copy link

nice

@bath-tub
Copy link

thank you king worked way easier than REST api stuff

@dkgndianko
Copy link
Author

thank you king worked way easier than REST api stuff

Happy that helped!

@nitinteotia6548
Copy link

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

@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