can't download github project with curl command

前端 未结 3 1228
故里飘歌
故里飘歌 2021-01-31 09:04

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

相关标签:
3条回答
  • 2021-01-31 09:44

    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.
    0 讨论(0)
  • 2021-01-31 10:01
    $ curl -I http://github.com/ziyaddin/xampp/archive/master.zip
    HTTP/1.1 301 Moved Permanently
    Server: GitHub.com
    Date: Sun, 28 Apr 2013 09:24:53 GMT
    Content-Type: text/html
    Content-Length: 178
    Connection: close
    Location: https://github.com/ziyaddin/xampp/archive/master.zip
    Vary: Accept-Encoding
    

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

    0 讨论(0)
  • 2021-01-31 10:09
    curl -L -O https://github.com/ziyaddin/xampp/archive/master.zip
    
    • you must use https://
    • you must use -L to follow redirects
    0 讨论(0)
提交回复
热议问题