bash - 无法使用 curl 命令下载 github 项目

标签 bash curl github download command

我使用“curl -sO”命令从此 GitHub 项目链接下载项目文件: http://github.com/ziyaddin/xampp/archive/master.zip

但是,我无法下载。发生错误并表示:

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.

但我可以使用 curl 命令下载此链接: http://cloud.github.com/downloads/pivotal/jasmine/jasmine-standalone-1.3.1.zip

我认为这是因为它在 cloud.github.com 中。我想知道如何使用 curl 命令从第一个链接下载?

最佳答案

curl -L -O https://github.com/ziyaddin/xampp/archive/master.zip
  • 您必须使用 https://
  • 您必须使用-L 来跟随重定向

关于bash - 无法使用 curl 命令下载 github 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16261100/

相关文章:

linux - 只接受 4 个字符长的十进制数字作为用户输入以供读取

ssl - 是否建议禁用 ssl 验证而不是在生产中提供 ca 证书?

git - 无法推送到 GitHub : Gist does not support directories

github - 如何在GitHub自述文件中向视频添加链接图像?

linux - 在 shell 脚本中操作数组(由 php-cli 打印)

linux - bash screen 命令多窗口模式

javascript - Node.js 忽略除第一个参数之外的所有查询字符串参数

bash - Unix cURL POST 到使用文件内容的特定变量

jenkins - Github Webhook 与 Jenkins 返回 302 Found

string - 如何在 Bash 中将字符串转换为小写