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%20D/_git/Project%20Derror: 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
2
Answers
Do you follow this doc?: Run Git commands in a script.
Check this option in your build definition:
Update:
How to Push Back to TFVC(Other steps are similar, the only different thing is the last step.):
Successfully on my side:
Original Answer:
I can reproduce your issue:
The operations that Shamrai suggested is needed, but not enough.
You need 3 steps:
Step1, allow script to access OAuth token
Step2, give contribute permission to build service account.
Step3, use this commands to push back changes:
git push origin HEAD:main
(Please notice add the HEAD:)