github-backup | A backup script for GitHub repositories | Continuous Backup library
kandi X-RAY | github-backup Summary
kandi X-RAY | github-backup Summary
This directory contains a script, backup.py, for backing up GitHub repositories. The script requires a GitHub token and a destination directory. It then uses the token to populate the destination directory with clones of all the repositories the token can access. Repeated runs only update the already existing backups and add new repositories, if any.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Mirror a repository
- Create a directory
- Yield all JSON data from a URL
- Validate a name
github-backup Key Features
github-backup Examples and Code Snippets
Community Discussions
Trending Discussions on github-backup
QUESTION
I have created a script that automatically backs up my GitHub repositories on a hard drive.
I use my Github username in combination with a personal access token to get authorized to Github. Now I've been reading a bit in their documentation about how to get ALL my repositories from the API (public & private), but I can only seem to get the public...
My script: https://github.com/TomTruyen/GitHub-Backup-Script/blob/main/github_backup_script.sh
From what I can understand on line 78, the url should return all my 'owned' repositories (which should include my privates ones)
...ANSWER
Answered 2021-Jun-30 at 19:33You're calling the /users
endpoint, but looking at List repositories for the authenticated user it looks like you should be calling /user/repos
.
By default this will return all repositories, both public and private, for the currently authenticated user. You'll also need to correctly handle pagination (unless you know for sure you have fewer than 100 repositories).
I was able to fetch a list of all my repositories using the following script:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install github-backup
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page