0
votes

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.

1
Can you share the log? do you use Hosted agent or Private agent?Shayki Abramczyk
Welcome to StackOverflow! Are you running this on an agent under your control? It may be that Git is popping up an Autorization pop-up... You may need to disable the Git Credential Manager for Windows in your system. github.com/Microsoft/Git-Credential-Manager-for-Windows/issues/…jessehouwing
I agree with @hessehouwing, and maybe you can remotely log into the the server as the account executing the build agent ,IF it is a private build agent, and seeing if the commands execute successfully and prompt for credentials. Whenever I have a build problem I always like to log into my build server as the build service account and resolve the issue that way.Antebios
@Shayki: I am using Private agent, for logfile click heresr5155
@jessehouwing: I disabled gcm in my server, still getting same problemsr5155

1 Answers

1
votes

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.