sr5155
sr5155

Reputation: 11

How to run git push command from Azure DevOps powershell task

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.

Upvotes: 0

Views: 1337

Answers (1)

jp nayak
jp nayak

Reputation: 35

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.

Upvotes: 1

Related Questions