Search code examples
gitazureazure-devopsazure-active-directorygit-clone

Error in checking out multiple repository from azure devops using git clone command


I am on classic Azure DevOps(not yaml). I read to use git clone command to check out the second repository in my 2nd phase of the build. When I am doing that I am getting this error which has no description. I see code is available in the folder, but still, the error is there. So, not sure if everything happened fine.

git clone -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" https://abc.visualstudio.com/Aq/_git/CodeRepo --verbose

enter image description here

These is the command I created enter image description here


Solution

  • This solution worked for me - I created a PowerShell command for this in my classic pipeline

    $env:GIT_REDIRECT_STDERR = '2>&1'
    git clone -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" https://abc.visualstudio.com/Aq/_git/CodeRepo