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?
git clone https://github.com/MY_USER/MY_REPO
?