0
votes

I am new to Azure DevOps and want to build a pipeline that migrates and deploys the CRM solution from dev env to production env. I followed this tutorial Build Azure DevOps Pipelines for Dynamics 365 CRM/Power Platform. When it reaches the CLI command it stops and an error appears as shown in the following image (Error message). the CLI command is as shown below:

echo commit all changes
git config user.email “Email@Email”
git config user.name “Automatic Build”
git checkout master
git add --all
git commit -m “solution export”
echo push code to new repo
git -c http.extraheader=”AUTHORIZATION: bearer $(System.AccessToken)” push origin master

this is the Solution OutPut File in "Power Platform Export Solution":

$(Build.ArtifactStagingDirectory)\$(SolutionName)_managed.zip

this is the Power Platform Unpack Solution :

Solution Input File

$(Build.ArtifactStagingDirectory)\$(SolutionName)_managed.zip

Target Folder to Unpack Solution

$(Build.SourcesDirectory)\$(SolutionName)_managed

Thanks in advance

1
You may not have a branch called master?Henk van Boeijen

1 Answers

0
votes

This issue: error: pathspec 'master' did not match any file(s) known to git is caused by the command git checkout master. In the Azure DevOps, the default branch name has been changed to main instead of master. We could see it in the repo->branch or build definition, check the pic below.

enter image description here

We need to change the branch name to main or other existing branch names.

For example:

git checkout main

Result:

enter image description here