无法从Private Repo下载Git存档tarball [英] Having trouble downloading Git archive tarballs from Private Repo

查看:92
本文介绍了无法从Private Repo下载Git存档tarball的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够以特定标签下载我们的应用程序,但我无法找到适用于此的工作解决方案。下载基于git标签的tarball似乎很有前途,但我无法使用Curl使它工作。我已经尝试了以下,但我回来的是github 404页面的源代码。

I need the ability to download our application at specific tags, but I am unable to find a working solution for this. Downloading tarballs based on git tag seems promising but I am unable to get it working using Curl. I have tried the following but all I get back is the source for the github 404 page.

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


推荐答案

这个要点列举了一些例子:

wget --no-check-certificate https://github.com/sebastianbergmann/phpunit/tarball/3.5.5 -O ~/tmp/cake_phpunit/phpunit.tgz

对于私人回购,请尝试在post指令中传递您的凭证信息:

For a private repo, try passing your credential information in a post directive:

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解决方法 ,并在以下内容中详细解释:

使用GitHub的AP的卷曲教程我

Or use a curl command as in SO question "git equivalent to svn export or github workaround", also explained in great details in:
"A curl tutorial using GitHub's API".


>


最终的curl命令看起来像这样:

The final curl command ended up looking something like this:



curl -sL --user "${username}:${password}" https://github.com/$account/$repo/tarball/$tag_name > tarball.tar

(为了便于阅读,可以多行)

(in multiple lines for readability)

curl -sL --user "${username}:${password}" 
  https://github.com/$account/$repo/tarball/$tag_name
  > tarball.tar

这篇关于无法从Private Repo下载Git存档tarball的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆