private repositories#3
Conversation
|
A couple things:
|
|
|
Thats so odd... |
|
Actually, reading that doc again, it says /users/:username/repos lists only the public repositories. So to get the private ones you have to use /user/repos. |
|
PR updated with some more changes, including the option for SSH. I added some consistency checks so you can't pass -u and -t that don't match, and you can't pass -P if the authentication doesn't match USER. |
changes to better support private repos:
- only check the authentication once!
- check the real username when an auth token is provided (error if
it doesn't match)
- this caused an infinite loop between get_auth/retrieve_data,
so I added a parameter to retrieve_data to escape that
- error if you pass -P but someone else's username
- optionally use SSH instead of HTTPS to clone
|
One more update: I realized that retrieve_data calls get_auth every time, and since I added an API call to get_auth that's not a good idea. So I memoized get_auth. |
|
I'll take a closer look at this tonight, thanks for the pull request :) |
|
This should work now - tested against my own account and an organization. If not, please reopen against master. |
|
I ran the following command and it did not include my private repositories. That token has permissions repo, gist, read:org, user. I'm assuming I made some simple mistake... |
QKT-42: releases - add readme info
I couldn't get github-backup to see my private repositories. It seems the /users/$user/repos API endpoint refuses to show them. So I changed it to use the /user/repos endpoint when authenticated. After that, I couldn't get it to correctly clone the private repositories, so I changed that part to use the SSH url instead of the HTTPS url. Now it Works On My Machine (tm).