无法通过备用git凭证在我的本地jenkins中克隆vsts repo

时间:2018-06-15 04:22:57

标签: macos jenkins azure-devops

无法通过备用git凭证在我的本地jenkins中克隆vsts repo,我的jenkins在MACOS上。以下解决方案对我不起作用,请协助。

Build挂在了 克隆远程Git存储库 克隆存储库https://yyyy.visualstudio.com/DefaultCollection/Subway%20Digital%20DevOps/_git/zzzz

  

git init / Users / Shared / Jenkins / Home / workspace / Test_Digital_Devops_repo #timetime = 10   从https://yyyy.visualstudio.com/DefaultCollection/zzzz/_git/zzzz获取上游更改   git --version #timeout = 10   使用GIT_ASKPASS设置凭据Standalone123n   git fetch --tags --progress https://yyyy.visualstudio.com/DefaultCollection/zzzz/_git/zzzz + refs / heads / :refs / remotes / origin /

1 个答案:

答案 0 :(得分:0)

VSTS git repo的URL应为:

https://account.visualstudio.com/DefaultCollection/project/_git/repo

要在git clone期间提供备用凭据,您应该将URL用作:

https://SeconaryUsername:SeconaryPassword@account.visualstudio.com/DefaultCollection/project/_git/repo

因此,当您执行git clone https://SeconaryUsername:SeconaryPassword@account.visualstudio.com/DefaultCollection/project/_git/repo时,它可以成功克隆VSTS git repo。

BTW:您还可以提供个人访问令牌( PAT )进行身份验证。 URL格式应为:

https://Personal%20Access%20Token:PAT@account.visualstudio.com/project/_git/repo