can't download github project with curl command can't download github project with curl command curl curl

can't download github project with curl command


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


You can also download a tarball (*.tar.gz) with:

curl -LkSs https://api.github.com/repos/ziyaddin/xampp/tarball -o master.tar.gz

or if you use the -O you can omit the filename, but then your saved ".tar.gz" file, is named by default to "tarball", so you have to rename it and add the ".tar.gz" filetype postfix. So use the (lowercase) -o as above. The rest:

  • Ss - use silent mode, but show errors, if any
  • k - use an insecure SSL connection without checking the TLS cert.


$ curl -I http://github.com/ziyaddin/xampp/archive/master.zipHTTP/1.1 301 Moved PermanentlyServer: GitHub.comDate: Sun, 28 Apr 2013 09:24:53 GMTContent-Type: text/htmlContent-Length: 178Connection: closeLocation: https://github.com/ziyaddin/xampp/archive/master.zipVary: Accept-Encoding

... so you need to use -L if you want to follow the HTTP redirect. Or just read Steven Penny's answer...