Search code examples
bashcurlgithubdownloadcommand

can't download github project with curl command


I used "curl -sO" command to download project files from this GitHub project link: http://github.com/ziyaddin/xampp/archive/master.zip

but, I couldn't download. There is error occured and says that:

Archive:  /home/ziyaddin/Desktop/master.zip
[/home/ziyaddin/Desktop/master.zip]   End-of-central-directory
signature not found.  Either this file is not   a zipfile, or it
constitutes one disk of a multi-part archive.  In the   latter case
the central directory and zipfile comment will be found on   the last
disk(s) of this archive. zipinfo:  cannot find zipfile directory in
one of /home/ziyaddin/Desktop/master.zip or
          /home/ziyaddin/Desktop/master.zip.zip, and cannot find 
/home/ziyaddin/Desktop/master.zip.ZIP, period.

but I can download this link with curl command: http://cloud.github.com/downloads/pivotal/jasmine/jasmine-standalone-1.3.1.zip

I think that it is because it is in cloud.github.com. I want to know how can I download from first link with curl command?


Solution

  • curl -L -O https://github.com/ziyaddin/xampp/archive/master.zip
    
    • you must use https://
    • you must use -L to follow redirects