首页 文章

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

提问于
浏览
0

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

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

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

1 回答

  • 0

    VSTS git repo的URL应该是:

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

    要在git clone期间提供 alternate credential ,您应该使用以下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
    

相关问题