我想从私人仓库下载一个文件,而不是克隆整个文件。
我能找到的所有结果都表明了同样的一点:在Bitbucket中创建一个应用程序密码,然后使用该密码沿着您的用户名。我试过了:
curl -u my_username:app_password https://bitbucket.org/my_username/the_repo/raw/commit_sha/the_file
我知道这个URL至少是合理的,因为如果我登录到Bitbucket,我可以在浏览器中查看它。
但运行curl命令失败,并显示错误:
Bitbucket Cloud recently stopped supporting account passwords for API authentication.
See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
App passwords are recommended for most use cases and can be created in your Personal settings:
https://bitbucket.org/account/settings/app-passwords/
For more details on API authentication methods see our documentation:
https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication
提到的第二个链接有一个关于应用程序密码的部分,并没有说太多关于如何实际使用它们。
使用git clone
的应用程序密码工作正常,但我不知道如何让它与curl一起工作。
1条答案
按热度按时间bq8i3lrv1#
这对我很有效:
位桶REST API文档