{"id":16675240,"url":"https://github.com/chsxf/git-repo-backup","last_synced_at":"2026-04-10T23:05:33.821Z","repository":{"id":62550452,"uuid":"495112410","full_name":"chsxf/git-repo-backup","owner":"chsxf","description":"A command-line tool to manage git repository backups - Works with GitHub or BitBucket","archived":false,"fork":false,"pushed_at":"2022-06-01T20:58:52.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T21:47:32.559Z","etag":null,"topics":["backup","backup-utility","bitbucket","git","github","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/chsxf.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":"2022-05-22T16:18:51.000Z","updated_at":"2022-06-01T21:02:18.000Z","dependencies_parsed_at":"2022-11-03T01:45:59.415Z","dependency_job_id":null,"html_url":"https://github.com/chsxf/git-repo-backup","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chsxf%2Fgit-repo-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chsxf%2Fgit-repo-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chsxf%2Fgit-repo-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chsxf%2Fgit-repo-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chsxf","download_url":"https://codeload.github.com/chsxf/git-repo-backup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243338154,"owners_count":20275436,"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":["backup","backup-utility","bitbucket","git","github","php"],"created_at":"2024-10-12T12:46:01.500Z","updated_at":"2025-12-28T23:38:46.829Z","avatar_url":"https://github.com/chsxf.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About This Project\n\n`git-repo-backup` is a command-line tool to manage git repository backups.\n\nAt the moment, it works only with GitHub or BitBucket Cloud.\n\n## Conventions\n\nThis project uses [gitmoji](https://gitmoji.dev) for its commit messages.\n\n# Installation\n\n## Requirements\n\n- [PHP](https://www.php.net/) 8.1+ with cURL extension enabled\n- [Composer](https://getcomposer.org)\n\n## Installing with Composer\n\n### Installing Globally\n\nWe recommend installing this package globally.\n\n```\ncomposer global require chsxf/git-repo-backup\n```\n\nIf not already, you need to add the global composer `bin` directory to your `PATH` environment variable.\n\n### Installing Locally\n\nBut you can also install it locally if it better fits your setup.\n\n```\ncomposer require chsxf/git-repo-backup\n```\n\nThe tool will be installed in the local `vendor` folder and the executable script can be called with the `vendor/bin/git-repo-backup` command.\n\n## Updating with Composer\n\nIf installed globally, you can run `composer global update chsxf/git-repo-backup`.\n\nIf installed locally, simply run `composer update chsxf/git-repo-backup` in the folder where the tool was previously installed.\n\n# Usage\n\n```\ngit-repo-backup\n    --username \u003cusername\u003e\n    --password \u003cpassword\u003e\n    --platform (github|bitbucket)\n    --clone-protocol (https|ssh)\n    [--no-git-lfs]\n    [--dest-dir \u003cdestination-path\u003e]\n    [--ssh-key \u003cssh-key-path\u003e]\n    [--exclude \u003cexcluded-repositories\u003e]\n    [--dry-run]\n    [--sort-by (size|name) (asc|desc)]\n```\n\n## Required Parameters\n\n| Parameter        | Description                                                                                                                                               |\n| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `username`       | **GitHub**: User name used to authenticate with the platform's API\u003cbr\u003e**BitBucket Cloud**: Workspace (user or organization) for which to get repositories |\n| `password`       | See [Passwords](#passwords) section below                                                                                                                 |\n| `platform`       | Platform on which the repositories are hosted\u003cbr\u003e\u003cbr\u003eAccepted values:\u003cbr\u003e\u003cul\u003e\u003cli\u003e`github`\u003c/li\u003e\u003cli\u003e`bitbucket` (BitBucket Cloud)\u003c/li\u003e\u003c/ul\u003e                 |\n| `clone-protocol` | Protocol to use when cloning/fetching the repositories\u003cbr\u003e\u003cbr\u003eAccepted values:\u003cbr\u003e\u003cul\u003e\u003cli\u003e`ssh` (recommended)\u003c/li\u003e\u003cli\u003e`https`\u003c/li\u003e\u003c/ul\u003e                   |\n\n## Optional Parameters\n\n| Parameter    | Description                                                                                                                                                                                                                                                                                                     |\n| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `no-git-lfs` | Skip availability test for Git LFS. Use this setting if you don't use Git LFS with any of your repositories.                                                                                                                                                                                                    |\n| `dest-dir`   | Destination path to store the repository backups. If not set, the script stores backups in current working directory.                                                                                                                                                                                           |\n| `ssh-key`    | **Not supported on Windows**\u003cbr\u003eSpecific SSH key to use with repositories, useful if you have several SSH keys for the same domain.\u003cbr\u003eThe specific path will be passed to git commands thanks to the `core.sshCommand` config.\u003cbr\u003eIgnored if `--clone-protocol` is set to `https`                              |\n| `exclude`    | Comma-separated list of excluded repositories\u003cbr\u003eEach entry can be either an exact match if containing only alphanumerical characters, hyphens and underscores, or a case-insensitive Perl-Compatible Regular Expression otherwise                                                                              |\n| `dry-run`    | If present, no clone or fetch/pull operation is done, and only repositories information are reported                                                                                                                                                                                                            |\n| `sort-by`    | Specify how repositories are sorted before being processed.\u003cbr\u003eRepositories can be sorted by `name` (default) or by `size`.\u003cbr\u003eOrder can ascending (`asc` - default) or descending (`desc`).\u003cbr\u003e\u003cbr\u003eAccepted values:\u003cbr\u003e\u003cul\u003e\u003cli\u003e`name asc`\u003c/li\u003e\u003cli\u003e`name desc`\u003c/li\u003e\u003cli\u003e`size asc`\u003c/li\u003e\u003cli\u003e`size desc`\u003c/li\u003e\u003c/ul\u003e |\n\n## Passwords\n\nThe `password` value differs from one platform to another.\n\nOn GitHub, the password must be a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).\n\nOn BitBucket Cloud, the password must be an [app password](https://bitbucket.org/account/settings/app-passwords/).\n\n# Planned Improvements\n\n- [ ] Support GitHub organizations\n- [ ] Allow the use of a configuration file\n\n# License\n\nThis repository is distributed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchsxf%2Fgit-repo-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchsxf%2Fgit-repo-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchsxf%2Fgit-repo-backup/lists"}