{"id":15550073,"url":"https://github.com/hscspring/backup-github-repo","last_synced_at":"2025-06-17T08:07:23.542Z","repository":{"id":105866779,"uuid":"183146304","full_name":"hscspring/backup-github-repo","owner":"hscspring","description":"backup a github repo.","archived":false,"fork":false,"pushed_at":"2023-07-25T16:13:55.000Z","size":20,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-13T15:57:11.250Z","etag":null,"topics":["backup-script","github-app","github-backup"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/hscspring.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-24T04:11:36.000Z","updated_at":"2021-04-18T20:02:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"dddde8a5-3bab-4618-b47b-d118067d1ff2","html_url":"https://github.com/hscspring/backup-github-repo","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"595414e9b340d7b19b75f9833ee587ba738b175b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hscspring/backup-github-repo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hscspring%2Fbackup-github-repo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hscspring%2Fbackup-github-repo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hscspring%2Fbackup-github-repo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hscspring%2Fbackup-github-repo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hscspring","download_url":"https://codeload.github.com/hscspring/backup-github-repo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hscspring%2Fbackup-github-repo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260318705,"owners_count":22991120,"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-script","github-app","github-backup"],"created_at":"2024-10-02T13:49:42.596Z","updated_at":"2025-06-17T08:07:23.508Z","avatar_url":"https://github.com/hscspring.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# backup-github-repo\nThis is a simple tool to backup a github repo.\n\n## Features\n\n- watch, star, fork info preserve\n- code clone\n- wiki clone (if exist)\n- issues and comments preserve\n\n## Install\n\nIf you have [pipenv](https://github.com/pypa/pipenv), it's easy to use `pipenv install` to install all the dependences, then you can use `pipenv shell` to enter the virtual environment. \n\nAlso, you could directly install all the dependences to your system using this command: `pipenv install --system --deploy`.\n\nOtherwise, `pip install -r requirements.txt` will be OK.\n\n## Usage\n\nFirst of all, edit the `env.conf` to add authentication info. Pay attention, `token` is necessary, `username` and `password` could be empty.\n\nHere are some steps to generate a token:\n\n- Login [GitHub](https://github.com)\n- Enter `Settings -\u003e Developer settings -\u003e Personal access tokens -\u003e Generate new token`\n- Enter a description ,whatever you like.\n- Select scopes following the [help](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), or simply you could select all of the `repo`.\n\nIf you are backing up a public repo, you need not to deal with the `env.conf`.\n\n### Backup a repo\n\n```bash\npython backup.py [OPTIONS]\n\nOptions:\n\t-O or --orgrepo_name\torgrepo name, like AIHackers/IAOC, username/reponame\n\t-P or --out_path\tdirectory to save your repo, default is \"./backup_data\n\t-I or --info\t\twhether to save watch, star and folk info, default is False\n\nExamples:\n\nBackup repo, wiki, and issues to ./backup_data\n$ python backup.py -O AIHackers/IAOC\n\nBackup repo, wiki, issues and info to ~/backup_data\n$ python backup.py -O AIHackers/IAOC -P ~/backup_data -I True\n\nThe final directory tree is like (cd ~/backup_data):\n.\n└── AIHackers\n    └── IAOC\n    \t├── code\n    \t│   ├── README.md\n    \t│   ├── ...\n        └── info\n        │   ├── forkers.txt\n        │   ├── starers.txt\n        │   └── watchers.txt\n        └── issue\n        │   ├── open_0_Hello1.txt // state + number + title for each issue\n        │   ├── closed_1_Hello2.txt // state + number + title for each issue\n        │   ├── ...\n        └── wiki\n        │   ├── README.md\n    \t│   ├── ...\n```\n\n### Backup all repos\n\nAlso you can use `list_allrepos.py` to create a bash scripts, with which you may easily backup any ones of your repos.\n\n```bash\npython list_allrepos.py [OPTIONS]\n\nOptions:\n\t-P or --out_path\tdirectory to save your repo, default is \"./backup_data\n\t-I or --info\t\twhether to save watch, star and folk info, default is False\n\nExamples:\n\nOutput a bash script named: batch.sh\n$ python list_allrepos.py -P ~/backup_data -I True\n$ chmod a+x batch.sh\n$ ./batch.sh\n```\n\n## Similars\n\n- [josegonzalez/python-github-backup: backup a github user or organization](https://github.com/josegonzalez/python-github-backup)\n- [taeguk/github-export: Export(Backup) your github repositories.](https://github.com/taeguk/github-export)\n- [kanishkegb/github-backup-all: A simple python script to back-up all the repos of a user to a local drive](https://github.com/kanishkegb/github-backup-all)\n- [ltpitt/python-github-backup: Python script to backup all repositories for a specific user, features backup rotation](https://github.com/ltpitt/python-github-backup)\n- [camptocamp/github-backup: A Python script to backup your GH organization](https://github.com/camptocamp/github-backup)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhscspring%2Fbackup-github-repo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhscspring%2Fbackup-github-repo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhscspring%2Fbackup-github-repo/lists"}