{"id":13611672,"url":"https://github.com/HR/github-clone","last_synced_at":"2025-04-13T05:33:12.504Z","repository":{"id":41484721,"uuid":"97055720","full_name":"HR/github-clone","owner":"HR","description":":octocat: ⬇️ ⠀git clone repo subdirectories","archived":false,"fork":false,"pushed_at":"2021-07-04T18:58:56.000Z","size":28,"stargazers_count":183,"open_issues_count":2,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-08T17:45:42.676Z","etag":null,"topics":["clone-repos","cloner","downloader","git","git-clone","git-subrepo","github-api","github-downloader","subdirectories"],"latest_commit_sha":null,"homepage":"https://git.io/ghclone","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HR.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-07-12T22:05:04.000Z","updated_at":"2025-02-20T17:42:13.000Z","dependencies_parsed_at":"2022-07-10T20:31:37.543Z","dependency_job_id":null,"html_url":"https://github.com/HR/github-clone","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/HR%2Fgithub-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HR%2Fgithub-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HR%2Fgithub-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HR%2Fgithub-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HR","download_url":"https://codeload.github.com/HR/github-clone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670513,"owners_count":21142896,"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":["clone-repos","cloner","downloader","git","git-clone","git-subrepo","github-api","github-downloader","subdirectories"],"created_at":"2024-08-01T19:01:59.933Z","updated_at":"2025-04-13T05:33:11.144Z","avatar_url":"https://github.com/HR.png","language":"Python","readme":"# GitHub clone\n\n[![PyPi Downloads](https://img.shields.io/pypi/dm/github-clone.svg?style=for-the-badge\u0026logo=pypi)](https://pypi.org/project/github-clone/)\n\nGit clone (download) any sub-directories of any GitHub repository (at any reference) without having to clone the entire repository, with only its GitHub URL.\nUses the GitHub API to recursively clone the sub-directories tree and files.\n\n## Motivation\n\nI often find myself wanting to only download a certain directory, path or package of an especially big repo that I'm currently viewing (without even cloning the entire repo at depth 1) and to do so by simply copy \u0026 pasting the GitHub URL so that's why. Probably more instances where this might come in handy ;)\n\n## Rate limit\nThe GitHub API imposes a [rate limiting](https://developer.github.com/v3/#rate-limiting) of up to 60 requests per hour applies but can be increased to up to 5000 requests per hour using an _OAuth token_ (to get one see https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line). \n\nGitHub clone makes an initial request to fetch repo metadata and then, a request for every subfolder in the repo. The requests to download the files within the folders are not counted against the rate limit so in most cases (i.e. the folder/repo you're trying to clone has less than 60 subfolders) the rate limit should not be a problem.\n\n## Private repositories\nTo clone private repositories you need to supply an _OAuth token_ for an account with access to the private repository (to get one see https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line).\n\n# Installation\n\nAvailable on PyPi https://pypi.org/project/github-clone/.\n\nInstall the script via `pip`:\n```\npip install github-clone\n```\nor via `pipsi`:\n```\npipsi install github-clone\n```\nUses Python 3.3+\n\n# Usage\n```\nGitHub clone (git.io/ghclone)\n\nUsage:\n  ghclone \u003curl\u003e [-t | --token=\u003ctoken\u003e]\n  ghclone (-h | --help)\n  ghclone (-v | --version)\n\nExamples:\n  ghclone https://github.com/HR/Crypter/tree/master/app\n  ghclone https://github.com/HR/Crypter/tree/dev/app\n  ghclone https://github.com/HR/Crypter/tree/v3.1.0/build\n  ghclone https://github.com/HR/Crypter/tree/cbee54dd720bb8aaa3a2111fcec667ca5f700510/build\n  ghclone https://github.com/HR/Picturesque/tree/master/app/src -t li50d67757gm20556d53f08126215725a698560b\n\nOptions:\n  -h --help           Show this screen.\n  -v --version        Show version.\n  -t --token=\u003ctoken\u003e  Set a GitHub OAuth token (see https://developer.github.com/v3/#rate-limiting).\n```\n# License\nCopyright (C) 2019-2021 Habib Rehman (https://git.io/HR)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n","funding_links":[],"categories":["Python","HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHR%2Fgithub-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHR%2Fgithub-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHR%2Fgithub-clone/lists"}