How to create and retrieve your Github tokens
Read our detailed guide on how to set up your GitHub Backup.
Creating your GitHub tokens
To back up your data with GitHub, you need to create a personal access token to connect GitHub to SimpleBackups.
These tokens allow access to GitHub resources when using the GitHub API or command line.
Currently, GitHub supports two types of personal access tokens:
- fine-grained personal access tokens
- classic personal access tokens.
SimpleBackups currently supports the classic token, which can be generated by going to:
Once you have created a classic personal access token, copy the token to use later to set up the connection with SimpleBackups.
Configuring your SimpleBackups Github backup
- Paste the token you generated earlier
- Enter your GitHub username
- Select options based on your unique circumstances:
- Whether the backup is for a private or organizational account. When you select the private account option, the backup will also include private repositories.
- Select which repositories you’d like to back up. You can choose between Starred Repos, Watched Repos, and Forked Repos. You can also choose to back up a specific repo.
- Choose other options you might want to back up. Based on your needs, you can run full backups, or back up only issues, pulls, wikis, gists, releases, or assets.
Restore your GitHub Backup to a New Repository
To restore a GitHub repository from a backup, as a new repository, you can follow these steps:
- First, create a new repository on GitHub with the same name as the repository you want to restore.
- Clone the newly created repository to your local machine using the
git clonecommand. For example:
git clone https://github.com/your-username/new-repo-name.git
- Navigate to the local repository directory on your machine using the
cdcommand. For example:
- Copy the contents of your backup (download from SimpleBackups, then go to
repositories/repo-name) into this directory. You can use the
cpcommand to do this. For example:
cp -r /path/to/backup/* /path/to/simplebackups/repository/repo-name
- Stage the changes using the
git addcommand. For example:
git add .
- Commit the changes using the
git commitcommand. For example:
git commit -m "Restoring backup"
- Push the changes to GitHub using the
git pushcommand. For example:
git push origin main(assuming
mainis the default branch of your repository)
That's it! Your repository should now be restored from your backup.
Last updated on August 6, 2021