Is there anyway to programmatically fetch a zipball of private github repo?

后端 未结 5 424
伪装坚强ぢ
伪装坚强ぢ 2020-12-24 06:10

We got a necessity to fetch a zipball of a private repo. For public ones it\'s pretty easy either through GitHub API or manually (https://github.com/user/repo/zipball/ma

5条回答
  •  清歌不尽
    2020-12-24 06:58

    I came across the same problem and this worked for me (as of Feb 2015):

    curl -O -J -L -u $YOUROAUTHKEY:x-oauth-basic https://github.com/$USER/$REPO/archive/master.zip
    

    The oAuth as a header solutions didn't work for me but what worked was stuffing the key into the username and specifying type. It then gave a 302 to redirect with the proper link.

    Verbose command really helped me troubleshoot whether the credentials I was using were being accepted or not (404 vs 401)

提交回复
热议问题