9
2
What I want to do is to download private repository archive from GitHub, extract it, remove archive file and copy some directories that are inside downloaded project.
I tried to use wget
but I cannot authorize myself:
wget --header='Authorization: token MY_TOKEN_CREATED_ON_GITHUB' https://github.com/MY_USER/MY_REPO/archive/master.tar.gz -O - | tar xz
I also tried with cURL
:
curl -i -H 'Authorization: token MY_TOKEN_CREATED_ON_GITHUB' https://github.com/MY_USER/MY_REPO/archive/master.tar.gz > file.tar.gz | tar xz
Here authorization passes, but I can't extract the file.
How to do that?
Why don't you just use
git clone https://github.com/MY_USER/MY_REPO
? – Tero Kilkanen – 2014-03-30T20:35:58.1171Because I'm doing it at server where there's no git. – Kamil Lelonek – 2014-03-30T21:17:52.837
Might solve your problem: http://stackoverflow.com/questions/23347134/downloading-a-tarball-from-github-without-curl
– errordeveloper – 2014-04-28T17:35:57.457