问题
We have some repos that we no longer need to keep on GitHub. If we use GitHub's archiving feature, the repos actually stay online. What we'd like instead is a way to download an archive of all the content (including issue reports) for a given repository, put that repository archive in a long-term preservation system, and delete the repo from GitHub. This is more than simply backing up a repository in the sense of other similar questions on Stack Overflow, and is more like what BackHub can do. Is there a tool or set of procedures (beyond git clone
) that will allow me to do this?
回答1:
If is preferable to use git clone --mirror, to get the full repo history and then
- git bundle --all to get only one file (easier to store than a collection of files)
- a long term storage system (example AWS S3)
Notes:
- you might want to clone the associated GitHub wiki as well, if you have one.
- that won't preserve your issues/Pull Requests
回答2:
python-github-backup can back up a single repository in an organizational account, as well as all repositories in an account. I have tried it on individual repositories, and it worked as hoped: using its --all
option, it captures issues, labels, milestones, pull requests, and wiki pages, as well as the repo itself.
Googling "github-backup" leads to other similar tools, but most of the others seem to have fewer features than python-github-backup or haven't been updated for many years. However, I must admit I haven't explored the other options very carefully.
Tip: the essential ingredient in using Google to find a suitable tool seems to be to search for the words "github" and "backup" specifically, and not include "archive" as I was doing in my original search, or even use more elaborate search strings such as "how make backup github repository".
回答3:
Use a folder on your local machine, google drive, or dropbox. No need to use github on non-active projects.
来源:https://stackoverflow.com/questions/54468658/how-can-i-create-a-complete-offline-archive-of-a-github-repository