1

我正在尝试通过 Azure DevOps 中的 bash 任务克隆私有 Bitbucket 存储库。这是命令

git clone --branch master https://username:password@bitbucket.org/repo.git

早些时候我收到了这个错误

"fatal: could not read Password for 'https://***@bitbucket.org': terminal prompts disabled"

这就是为什么我在 URL 中也包含密码以使其正常工作,但现在我明白了。

fatal: unable to access 'https://bitbucket.org/realogy-abt/apipublishing.git/': Could not resolve host: ***

我尝试使用 user.name 和 email 以及远程源 url 设置全局 git 配置,但没有任何效果。

git config --global user.email "xxx"
git config --global user.name "xxxx"

我正在通过 Azure DevOps 中的 bash 任务尝试此操作。任何帮助,将不胜感激。编辑添加:相同的克隆与 Github 存储库无缝协作。

4

1 回答 1

1

我使用下面的 git 命令在 bash 任务中对其进行了测试,并且它有效。

git clone https://username:password@bitbucket.org/Workspace ID/repository.git

在此处输入图像描述

在此处输入图像描述

用户名显示在 Bitbucket 配置文件设置中。

在此处输入图像描述

于 2019-08-22T11:14:22.303 回答