{"id":23284226,"url":"https://github.com/agilecreativity/github_copier","last_synced_at":"2025-04-06T15:15:16.008Z","repository":{"id":56874310,"uuid":"55030217","full_name":"agilecreativity/github_copier","owner":"agilecreativity","description":"List/clone repositories from Github by user/organization include support for private repository","archived":false,"fork":false,"pushed_at":"2019-10-31T11:38:52.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T05:01:57.310Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agilecreativity.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-30T03:40:36.000Z","updated_at":"2019-10-31T11:38:54.000Z","dependencies_parsed_at":"2022-08-20T10:11:13.141Z","dependency_job_id":null,"html_url":"https://github.com/agilecreativity/github_copier","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fgithub_copier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fgithub_copier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fgithub_copier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fgithub_copier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agilecreativity","download_url":"https://codeload.github.com/agilecreativity/github_copier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247500476,"owners_count":20948880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-20T01:38:48.893Z","updated_at":"2025-04-06T15:15:15.954Z","avatar_url":"https://github.com/agilecreativity.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## GithubCopier\n\nExport/clone Github repository (public/private) by user or organization name\n\n[![Gem Version](https://badge.fury.io/rb/github_copier.svg)][gem]\n[![Dependency Status](https://gemnasium.com/agilecreativity/github_copier.png)][gemnasium]\n[![Code Climate](https://codeclimate.com/github/agilecreativity/github_copier.png)][codeclimate]\n\n[gem]: http://badge.fury.io/rb/github_copier\n[gemnasium]: https://gemnasium.com/agilecreativity/github_copier\n[codeclimate]: https://codeclimate.com/github/agilecreativity/github_copier\n\n### Why\n\n- Be able to get grab all of interesting codes from a given user quickly\n- Be able to clone specific language for a given user/organization\n- Be able to clone all of organization/users in one go if desired\n- Be able to clone private/public repositories for a given user/organization\n- Be able to learn quickly or look at how something works from the source code\n- I am too lazy to do this manually or through some other shell script\n\n### Installation\n\n```sh\n# Install the gem\ngem install github_copier\n\n# refresh your gem just in case\nrbenv rehash\n\n# Get list of options just type the name of the gem\ngithub_copier\n```\n\nYou should see something like\n\n```\nUsage: github_copier [options]\n\nSpecific options:\n    -b, --base-dir BASE_DIR          where BASE_DIR is the directory where the repositories will be cloned to (mandatory)\n                                     If not specified, current directory will be used\n    -u, --user USER                  The Github USER that will be cloned from (mandatory)\n    -o, --org [ORG]                  The Github's organization name to be used if specified (optional)\n                                     where ORG is the organization that the user belongs to\n    -t, --oauth-token [OAUTH_TOKEN]  The Github's oauth_token for authentication (optional - only required to list/clone private repositories)\n                                     where OAUTH_TOKEN is from the user's Github setting\n    -l, --language [LANG]            Clone only project of type LANG (optional)\n                                     where LANG is main language as shown on Github\n    -a, --[no-]all-repos             All repository only (optional)\n                                     default to original/non-forked repositories only\n    -g, --[no-]group-by-user         Group the output by {BASE_DIR}/{USER}/{LANG}\n                                     default to {BASE_DIR}/{LANG}/{USER}\n    -c, --[no-]clone                 Clone the repositories to the path specified (optional)\n                                     default to --no-clone e.g. dry-run only\n\nCommon options:\n    -h, --help                       Show this message\n```\n\n- List repositories by user or organization id\n\n```sh\n# List all original/non-forked repositories by `awesome_user`\n$github_copier --user awesome_user\n\n## List all original/non-forked repositories of a user `awesome_user` that belongs to `AwesomeCo`\n$github_copier --user awesome_user --org AwesomeCo\n\n## List all origina/non-forked repositories by user `awesome_user` including private repository\n# Note: for this to work you will need to have the proper access with the right token\n$github_copier --user awesome_user --oauth-token GITHUB_TOKEN_FOR_THIS_USER\n\n## List all repositories by user `awesome_user` include forked repositories\n$github_copier --user awesome_user --oauth-token GITHUB_TOKEN_FOR_THIS_USER\n```\n\n- List and clone repositories by user or organization id using `--clone` option\n\n```sh\n## Clone all original (non-fork) public `JavaScript` repositores for user `awesome_user` to `~/Desktop/github`\n# Note: --base-dir is optional, if not specified then the current directory will be used\n#       --language must be quoted if the value include any spaces e.g. \"Emacs Lisp\" for this to to work properly\n$github_copier --user awesome_user \\\n               --base-dir ~/Desktop/github \\\n               --language \"JavaScript\" \\\n               --clone\n\n## Clone all public/private repositories for `awesome_user` which are member of `AwesomeCo` organization to `~/Desktop/github`\n# Note: the option `--all` to include all forked repositories\n$github_copier --user awesome_user \\\n               --org AwesomeCo \\\n               --all-repos \\\n               --base-dir ~/Desktop/github \\\n               --oauth-token GITHUB_TOKEN_FOR_AWESOME_USER \\\n               --clone\n\n## Clone specific type of project (e.g. `Java` in this case) public/private repositories for `awesome_user`\n## which are member of `AwesomeCo` organization to `~/Desktop/github`\n$github_copier --user awesome_user \\\n               --org AwesomeCo \\\n               --all-repos \\\n               --language \"Java\" \\\n               --base-dir ~/Desktop/github \\\n               --oauth-token GITHUB_TOKEN_FOR_AWESOME_USER \\\n               --clone\n```\n\n### Example Sessions\n\n- List repositories by a given user (dry-run)\n\n```\n$github_copier -b ~/Desktop/projects -u littlebee -l Ruby\n------------------------------------------\nList of languages by littlebee\nMakefile\nCoffeeScript\nRuby\nJavaScript\nArduino\n------------------------------------------\n------------------------------------------\nList of all repositories by littlebee\n1/15: littlebee/Makefile/arduino-mk\n2/15: littlebee/CoffeeScript/bumble-build\n3/15: littlebee/CoffeeScript/bumble-docs\n4/15: littlebee/CoffeeScript/bumble-strings\n5/15: littlebee/CoffeeScript/bumble-test\n6/15: littlebee/CoffeeScript/bumble-util\n7/15: littlebee/CoffeeScript/git-log-utils\n8/15: littlebee/CoffeeScript/git-status-utils\n9/15: littlebee/CoffeeScript/git-time-machine\n10/15: littlebee/CoffeeScript/notjs\n11/15: littlebee/CoffeeScript/publish\n12/15: littlebee/CoffeeScript/react-focus-trap-amd\n13/15: littlebee/Ruby/got\n14/15: littlebee/JavaScript/selectable-collection\n15/15: littlebee/Arduino/solar-sunflower\n------------------------------------------\nFYI: dry-run only, no action taken!!\nProcess 1 of 1 : git clone git@github.com:littlebee/got.git /Users/bchoomnuan/Desktop/projects/Ruby/littlebee/got\n```\n\n- List and clone repositories for a given user (e.g. `--clone` option used)\n\n```\n$github_copier -b ~/Desktop/projects -u littlebee -l Ruby -c\n------------------------------------------\nList of languages by littlebee\nMakefile\nCoffeeScript\nRuby\nJavaScript\nArduino\n------------------------------------------\n------------------------------------------\nList of all repositories by littlebee\n1/15: littlebee/Makefile/arduino-mk\n2/15: littlebee/CoffeeScript/bumble-build\n3/15: littlebee/CoffeeScript/bumble-docs\n4/15: littlebee/CoffeeScript/bumble-strings\n5/15: littlebee/CoffeeScript/bumble-test\n6/15: littlebee/CoffeeScript/bumble-util\n7/15: littlebee/CoffeeScript/git-log-utils\n8/15: littlebee/CoffeeScript/git-status-utils\n9/15: littlebee/CoffeeScript/git-time-machine\n10/15: littlebee/CoffeeScript/notjs\n11/15: littlebee/CoffeeScript/publish\n12/15: littlebee/CoffeeScript/react-focus-trap-amd\n13/15: littlebee/Ruby/got\n14/15: littlebee/JavaScript/selectable-collection\n15/15: littlebee/Arduino/solar-sunflower\n------------------------------------------\nProcess 1 of 1 : git clone git@github.com:littlebee/got.git /Users/bchoomnuan/Desktop/projects/Ruby/littlebee/got\n```\n\n### TODO\n\n- Replace system call with the ruby library like [grit](https://github.com/mojombo/grit) or something similar\n- Allow the `https` when performing the clone\n\n### Related Projects\n\n- [github_cloner](https://github.com/nashby/github_cloner) by Vasiliy Ermolovich\n\n### Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n[Thor]: https://github.com/erikhuda/thor\n[Minitest]: https://github.com/seattlerb/minitest\n[RSpec]: https://github.com/rspec\n[Guard]: https://github.com/guard/guard\n[Yard]: https://github.com/lsegal/yard\n[Pry]: https://github.com/pry/pry\n[Rubocop]: https://github.com/bbatsov/rubocop\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilecreativity%2Fgithub_copier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagilecreativity%2Fgithub_copier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilecreativity%2Fgithub_copier/lists"}