Export GitHub projects using the experimental user migrations API.
This tool allows exporting a copy of all your projects, something the user migrations API does not provide out of box.
You need a personal access token to use the user migrations API.
- Open https://github.com/settings/tokens
- Generate new token
- Token description: github-gdpr-export
- Select scopes: [x] repo
Save this token somewhere.
$ ./github-gdpr-export.py --token $TOKEN list-users-repos > repolist.txt
$ xargs ./github-gdpr-export.py --token $TOKEN start < repolist.txt
Migration id 12345 created
$ ./github-gdpr-export.py --token $TOKEN list
id state lock
12345 exported 0
$ ./github-gdpr-export.py --token $TOKEN download 12345 export.tar.gz
Downloading "<URL>" into "export.tar.gz"