我需要能够在特定标签下载我们的应用程序,但我无法为此找到可行的解决方案。基于 git 标签下载 tarball 似乎很有前途,但我无法使用 Curl 让它工作。我尝试了以下方法,但我得到的只是 github 404 页面的源代码。
curl -sL https://github.com/$ACCOUNT/$PRIVATE_REPO/tarball/0.2.0.257m?login=$MY_USER_NAME&token=$MY_TOKEN > 0.2.0.257m.tar
对于公共回购,你有这个要点 https://gist.github.com/758124列出一些例子:
wget --no-check-certificate https://github.com/sebastianbergmann/phpunit/tarball/3.5.5 -O ~/tmp/cake_phpunit/phpunit.tgz
对于私人存储库,请尝试在 post 指令中传递您的凭据信息:
wget --quiet --post-data="login=${login}&token=${token}" --no-check-certificate https://github.com/$ACCOUNT/$PRIVATE_REPO/tarball/0.2.0.257m
或者使用curl命令,如SO问题“git 相当于svn export或 github 解决方法 https://stackoverflow.com/a/9329607/6309”,还详细解释了:
"使用 GitHub 的 API 的curl 教程 https://gist.github.com/2288960".
The OP 史蒂文·Jp https://stackoverflow.com/users/1317806/steven-jp报告已作出curl
指挥工作:
最终的curl命令看起来像这样:
curl -sL --user "${username}:${password}" https://github.com/$account/$repo/tarball/$tag_name > tarball.tar
(为了便于阅读,多行)
curl -sL --user "${username}:${password}"
https://github.com/$account/$repo/tarball/$tag_name
> tarball.tar
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)