{"id":51747847,"url":"https://github.com/hyperphantasia/clone-github-user-repos","last_synced_at":"2026-07-18T21:43:25.019Z","repository":{"id":350094480,"uuid":"1193124966","full_name":"hyperphantasia/clone-github-user-repos","owner":"hyperphantasia","description":"Clone all public repos for a GitHub user with a single command: ideal for bulk cloning and local backups.","archived":false,"fork":false,"pushed_at":"2026-04-12T19:01:23.000Z","size":190,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-16T14:54:02.025Z","etag":null,"topics":["automation","backup","bash","bulk-clone","cli-tool","clone","clone-repos","deb-package","debian","git","git-tools","github","github-api","mirror","repo-backup","shell-script","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperphantasia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-26T22:40:46.000Z","updated_at":"2026-04-12T19:01:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hyperphantasia/clone-github-user-repos","commit_stats":null,"previous_names":["brooks-code/clone-github-user-repos","hyperphantasia/clone-github-user-repos"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hyperphantasia/clone-github-user-repos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperphantasia%2Fclone-github-user-repos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperphantasia%2Fclone-github-user-repos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperphantasia%2Fclone-github-user-repos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperphantasia%2Fclone-github-user-repos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperphantasia","download_url":"https://codeload.github.com/hyperphantasia/clone-github-user-repos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperphantasia%2Fclone-github-user-repos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35632492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-18T02:00:07.223Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["automation","backup","bash","bulk-clone","cli-tool","clone","clone-repos","deb-package","debian","git","git-tools","github","github-api","mirror","repo-backup","shell-script","ubuntu"],"created_at":"2026-07-18T21:43:24.492Z","updated_at":"2026-07-18T21:43:24.998Z","avatar_url":"https://github.com/hyperphantasia.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backup your GitHub repos\n\n**One line to clone them all.**\n\n![Banner Image](/img/artemis_moon.jpg \"The dark side of the moon. An Artemis view\")\n\n*No CGI. Thank you [NASA](https://www.flickr.com/photos/nasahqphoto/)!*\n\n`gh-clone-all` is a small Debian package that clones public repos locally for a specified GitHub username.\n\n## Genesis\n\n\u003e This script started as the challenge to code a small shell one-liner, and avoid the hassle of manually copying each clone URL. Created to quickly mirror or back up all public repositories for a GitHub account without manually copying each clone URL when migrating systems. It eventually just grew into a full, reusable package.\n\n## Table of contents\n\n\u003cdetails\u003e\n\u003csummary\u003eContents - click to expand\u003c/summary\u003e\n\n- [Backup your GitHub repos](#backup-your-github-repos)\n  - [Genesis](#genesis)\n  - [Table of contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n  - [Project layout](#project-layout)\n  - [What the tool does](#what-the-tool-does)\n  - [Installation and usage: the easy way](#installation-and-usage-the-easy-way)\n    - [Using the standalone script only](#using-the-standalone-script-only)\n    - [Build the `.deb` by yourself](#build-the-deb-by-yourself)\n      - [Install the package](#install-the-package)\n      - [Run the tool](#run-the-tool)\n        - [Example output](#example-output)\n  - [Limitations](#limitations)\n  - [Improvements](#improvements)\n  - [License](#license)\n  - [And for the beauty of the view](#and-for-the-beauty-of-the-view)\n\n\u003c/details\u003e\n\n## Features\n\n- Prompts for a GitHub username if not provided via command-line arguments.\n- Lists the user’s public repositories via the GitHub REST API.\n- Clones each repository with `git clone`.\n- Packaged as a `.deb` for easy installation on Debian-based systems.\n\n## Requirements\n\nDebian or Ubuntu-based system.\n\n- `curl`\n- `git`\n- `awk`\n- `grep`\n- `sed`\n- `xargs` found in `findutils`\n\nThese dependencies are included in the package metadata so they are installed automatically when possible.\n\n## Project layout\n\n```text\nclone-github-user-repos/\n├── img/\n├── src/\n|   ├── build.sh\n|   └── gh-clone-all_script.sh\n├── install_gh-clone-all.sh\n└── README.md\n\n.deb Package structure\n└── gh-clone-all_1.0.0_all/\n    ├── DEBIAN/\n    │   └── control\n    └── usr/\n        └── bin/\n            └── gh-clone-all\n```\n\n## What the tool does\n\nThe script asks for a GitHub username (if not specified in CLI arguments), calls the GitHub REST API for that user’s repositories ((JSON) with per_page=100), extracts each repository’s `clone_url`, and runs `git clone` for every result.\n\n\u003e [!NOTE]\n\u003e GitHub’s repository listing API is paginated, and the `per_page` parameter supports up to 100 results per page, so accounts with more than 100 repositories will need pagination support (not implemented) if you want every repository cloned.\n\n## Installation and usage: the easy way\n\nJust run the command below under Ubuntu/Debian and wait for the script to execute.\n\n- Download and execute the installation script:\n\n```bash\ncurl -sL https://raw.githubusercontent.com/brooks-code/clone-github-user-repos/main/install_gh-clone-all.sh | bash\n```\n\n### Using the standalone script only\n\nIf you prefer just running the scriplet without installation, the script is located in the `src` folder.\n\n- Pass a substitution before running:\n\n```bash\nUSERNAME=octocat ./gh-clone-all_script.sh          \n```\n\n- Or edit the URL to include your username directly in the script\n\n```bash\n# Replace the USERNAME in the line below\ncurl -s \"https://api.github.com/users/USERNAME/repos?per_page=100\"\n```\n\n### Build the `.deb` by yourself\n\nMake the build script executable and run it:\n\n```bash\nchmod +x build.sh\n./build.sh\n```\n\nThis will create a file named similar to:\n\n```text\ngh-clone-all_1.0.0_all.deb\n```\n\nThe `.deb` is created from a directory tree that contains a `DEBIAN` metadata directory and the files to be installed into the target filesystem.\n\n#### Install the package\n\nInstall the local package with `apt`:\n\n```bash\nsudo apt install ./gh-clone-all_1.0.0_all.deb\n```\n\nYou can also use `dpkg -i`, but `apt` is often preferred for local `.deb` installs (because it can resolve dependencies more conveniently).\n\n#### Run the tool\n\nAfter a succesfull installation, run:\n\n```bash\ngh-clone-all octocat\n```\n\nor\n\n```bash\ngh-clone-all\n```\n\nand when prompted, enter a GitHub username such as:\n\n```text\noctocat\n```\n\nThe script will then clone that user’s public repositories into the current directory.\n\n##### Example output\n\n```bash\n$ github-clone-all\nEnter GitHub username: octocat\nCloning into 'Spoon-Knife'...\nCloning into 'Hello-World'...\n```\n\n## Removal instructions\n\nJust run:\n\n```bash\nsudo apt remove gh-clone-all\n```\n\n## Limitations\n\n\u003e [!NOTE]\n\u003e This clones up to 100 repos. pagination support for more is note implemented (yet).\n\u003e\n\u003e The command targets **public repositories** by default. Use authenticated endpoints to access private repos.\n\nAnd last but not least..\n\n- Be mindful of GitHub API **rate limits** for unauthenticated requests.\n- Cloning many repos can consume significant disk space and network bandwidth.\n\n## Improvements\n\nPossible improvements include:\n\n- [ ] Adding pagination support for users with large numbers of repositories.\n- [ ] Option to filter out forks or archived repositories.\n- [X] Adding a username command-line option alongside interactive prompting.\n\n## License\n\nThe source code is provided under the [Unlicense](https://unlicense.org/) license. See the [LICENSE](/LICENSE) file for details.\n\n## And for the beauty of the view\n\n![Banner Image](/img/crescent_earth.jpg \"Earthrise.\")\n\n*Just to [see](https://ucly.hal.science/hal-05184143v1) the [view](https://chopplet.canalblog.com/archives/2024/01/02/40162097.html).*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperphantasia%2Fclone-github-user-repos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperphantasia%2Fclone-github-user-repos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperphantasia%2Fclone-github-user-repos/lists"}