https://github.com/meskill/gh-backup
Backup for some of my github repositories
https://github.com/meskill/gh-backup
gh-backup
Last synced: 3 months ago
JSON representation
Backup for some of my github repositories
- Host: GitHub
- URL: https://github.com/meskill/gh-backup
- Owner: meskill
- License: unlicense
- Created: 2022-05-04T14:44:24.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-20T08:21:39.000Z (almost 2 years ago)
- Last Synced: 2025-07-29T05:52:02.407Z (10 months ago)
- Topics: gh-backup
- Language: Nushell
- Homepage:
- Size: 3.9 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Repositories backup
## How does it work
- uses [ghorg](https://github.com/gabrie30/ghorg) to copy all of the repos from github to local folder
- walks from all of the repos and pushes it to sourcehut (if repo not exists on sourcehut it will be automatically created)
- it stores bare git minimum to restore repository from the backup
- script copies only repositories with topic `gh-backup`
## Usage
### Run backup
1. Make sure you have ssh keys for sourcehut added to your local ssh instance
2. Create and copy [Github Personal Access Token](https://github.com/settings/tokens) with every `repo` access. Make it live for short time
3. Run script `./backup.sh`
4. Enter PAT when asked
5. Verify the output
6. Delete token after usage from the github page
### Add a new repo to backup
1. Go to the github page of the repo
2. Click gear icon on the right, next to about
3. Add topic `gh-backup`
### Restore repository from the backup
1. Run command `git clone `
2. Run `git remote rm origin` to remove link to backup repo or `git remote set-url origin `