Home > Software engineering >  Command line script error in Azure devops pipeline
Command line script error in Azure devops pipeline

Time:09-16

Am getting the following error message in cmd line script while runing the pipeline in azure devops.

error: src refspec main does not match any error: failed to push some refs to 'https://dev.azure.com/DevendraPadhi/Project D/_git/Project D

error: pathspec 'main' did not match any file(s) known to git fatal: Cannot prompt because user interactivity has been disabled. fatal: Cannot prompt because user interactivity has been disabled. fatal: could not read Password for 'https://[email protected]/DevendraPadhi/Project D/_git/Project D': terminal prompts disabled

PLease help to overcome this

Commanad line script (GIT)

Azure pipeline Error message for Command line script

CodePudding user response:

Do you follow this doc?: enter image description here

CodePudding user response:

I can reproduce your issue:

enter image description here

The operations that Shamrai suggested is needed, but not enough.

You need 3 steps:

Step1, allow script to access OAuth token

enter image description here

Step2, give contribute permission to build service account.

enter image description here

enter image description here

Step3, use this commands to push back changes:

git push origin HEAD:main

(Please notice add the HEAD:)

  • Related