I want to run a PowerShell task in Azure DevOps.
I gave the script path in the PowerShell task. I have written execution of git commands in this script file. add & commit has been executed from the Azure portal, but not able to execute push command, the build frozen after committing.
I came across such problem recently while configuring git commands in Azure DevOPs. This is how I am able to git push
"Config Set"
git config user.email "$(Build.RequestedForEmail)"
git config user.name "$(Build.RequestedFor)"
"Push new Branch"
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push origin master:refs/heads/my-branch
Hope this helps someone else.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.