clockfort / GitHub-Backup

Backup all the repositories of a github user or organization automatically.
Creative Commons Zero v1.0 Universal
359 stars 103 forks source link

Private repos cause errors #17

Closed za3k closed 5 years ago

za3k commented 9 years ago

I have a (forked) private repo. When I try to back it up (with -t authorization, if relevant), the clone fails.

This should either be skipped or work (work, I think?)

1c7 commented 8 years ago

wow, 2014 is two years ago, and no one ever comment this
by the way, I got this problem too, I have a private repo that are disable, and would cause script stop and say

Processing repo: DrinknLink/teamwork
Repo doesn't exists, lets clone it
Cloning into '1c7/teamwork'...
fatal: remote error: 
  Repository not found.
Traceback (most recent call last):
  File "github-backup.py", line 122, in <module>
    main()
  File "github-backup.py", line 46, in main
    process_repo(repo, args)
  File "github-backup.py", line 83, in process_repo
    update_repo(repo, dir, args)
  File "github-backup.py", line 97, in update_repo
    os.chdir(dir)
OSError: [Errno 2] No such file or directory: '1c7/teamwork'
ankush-grover-3pg commented 8 years ago

Same issue, not able to backup private repos and getting the same error as above..

Enrico204 commented 8 years ago

Hi guys,

unfortunately I can't create private repos. I'll attempt to fix using your stacktraces.

Are you using SSH ("-S" option). Did you have any saved credentials for SSH/HTTPS (ie. ssh key without password / ssh key agent with an UI / user and password saved in config) ? Which kind?

I think that the problem is on "git clone" part: without authentication GitHub refuses to allow access to private repositories. A temporary workaround maybe use a public/private key pair and SSH to have a seamsless login. Can you try this and report back? Thanks :-)

@1c7 you're saying that "1c7/teamwork" is disabled? If so, the script cannot access to the repository so I think that the best option is to skip that kind of repos.

stv0g commented 5 years ago

Should be fixed by #30 as long as you use SSH for cloning (-t ssh)

stv0g commented 5 years ago

@clockfort Can we close it too?