在Azure DevOps中克隆私有BitBucket存储库

时间:2019-08-21 10:39:37

标签: git github azure-devops bitbucket-cloud

我正在尝试通过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 config,但是没有任何效果。

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

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

1 个答案:

答案 0 :(得分:2)

我使用下面的git命令在bash任务中对其进行了测试,并且可以正常工作。

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

enter image description here

enter image description here

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

enter image description here