gpt4 book ai didi

git - 如何从私有(private) Github 存储库下载二进制文件?

转载 作者:可可西里 更新时间:2023-11-01 16:40:31 24 4
gpt4 key购买 nike

我正在尝试从我的一个私有(private)存储库下载最新版本,我正在使用此代码下载它:

curl -i -H "Authorization: token $AUTH_KEY" \
https://api.github.com/repos/haccks/Test/releases/latest

上述请求的响应返回 Assets ID (7052110) 以及其他详细信息。然后我用了

curl -L -H "Accept: application/octet-stream" \
https://$AUTH_KEY:@api.github.com/repos/haccks/Test/releases/assets/7052110

出现这个错误:

{
"message": "Not Found",
"documentation_url": "https://developer.github.com/v3"
}

我也试过wget

wget --auth-no-challenge --header='Accept: application/octet-stream' \ 
https://$AUTH_KEY:@api.github.com/repos/haccks/Test/releases/assets/7052110

返回:

HTTP request sent, awaiting response... 404 Not Found
2017-07-15 20:46:26 ERROR 404: Not Found.

出了什么问题?

最佳答案

由于 -H "Authorization: token $AUTH_KEY" 对之前的 API 调用有效,您可以尝试使用 a curl with multiple headers :

curl -L -H "Accept: application/octet-stream" \
-H "Authorization: token $AUTH_KEY" \
https://api.github.com/repos/haccks/Test/releases/assets/7052110

关于git - 如何从私有(private) Github 存储库下载二进制文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45119794/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com