You can use a third-party tool to back up your repository, or you can use the API to download and back up your repository manually.
Third-party backup tools
A number of self-service tools exist that automate backups of repositories. Unlike archival projects, which archive all public repositories on GitHub and make the data accessible to anyone, backup tools will download data from specific repositories and organize it within a new branch or directory.
You can back up all of a repository's Git data (such as project files and commit history), as well as much data from GitHub (such as issues and pull requests), with:
- github-backup, which backs up any public repository, or all repositories owned by a particular user.
- GitHub Records Archiver, which backs up all of an organization's public repositories.
For information about backups that GitHub makes for security purposes, see "File system and backups."
Downloading content manually
If you don't want to use a third-party tool, you can download and back up your repositories manually:
- To download a repository's Git data to your local machine, you'll need to clone the repository. For more information, see "Cloning a repository."
- You can also download your repository's wiki. For more information, see "Cloning wikis locally to your computer."
When you clone a repository or wiki, only Git data, such as project files and commit history, is downloaded. You can use our API to export other elements of your GitHub repository to your local machine:
Creating backups of downloaded content
Once you have a local version of all the content you want to back up, you can create a zip archive and copy it to an external hard drive and/or upload it to a cloud-based backup service such as Google Drive or DropBox.