git - 在 git clone 命令中使用密码克隆 BitBucket 存储库会导致问题

标签 git azure bitbucket bitbucket-cloud

我尝试使用 git clone 命令中的密码来克隆存储库,但总是会出现以下错误:

remote: Login failed due to incorrect login credentials or method.
remote: If you are unsure of which login details or login method to use, visit:
remote: https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cloud/
fatal: Authentication failed for 'http://bitbucket.org/qhluo123/ceye-admin.git/'

这是我的克隆命令:

git clone http://username:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="deaebfadada9b1acba9ebcb7aabcabbdb5bbaaf0b1acb9" rel="noreferrer noopener nofollow">[email protected]</a>/qhluo123/ceye-admin.git

我无法使用 ssh 或 pop 密码方法,因为我正在远程系统上自动克隆和部署存储库。在此过程中,用户方无法进行任何输入。有什么办法可以解决这个问题吗?

添加 SSH 并不是一个解决方案,因为我将其部署在 Microsoft 的 ARM 模板中,而 ARM 模板始终会创建一个新的虚拟机。

最佳答案

尝试使用 HTTPS access token而不是您的帐户密码。

大多数远程 Git 存储库托管服务(GitHub、GitLab、Bitbucket)使用 token 作为密码。

最好使用 Git Credential helper ,例如,如per Azure documentationGit Credential Manager附带 Git For Windows .
这样,您就不必在纯文本 URL 中使用您的 token 。

就您而言,由于克隆是在远程部署 ARM 服务器上进行的,因此这可能不适用,但使用 token 而不是密码仍然是推荐的选项。

关于git - 在 git clone 命令中使用密码克隆 BitBucket 存储库会导致问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75613168/

相关文章:

git - 推送到远程分支(更新 ref 失败)

git - 重用 git 存储库的一部分

git - 源代码树 - 如何还原推送的提交

git - 从现有提交创建新分支,现在 origin 和 origin/master 不同步

c - 如何从设备将设备注册到azure iot hub(使用iot客户端c sdk)

ssh - Satis、Bitbucket 和 SSH

git - 无法让 github 的 webhook URL 在我的服务器上工作

c# - 应用程序不加载azure应用程序配置功能标志值,但加载配置值

python - Azure 认知搜索 - 长文本中的关键字搜索 - 未返回预期结果

git - git无法克隆:远端意外挂断