3
votes

I've GIT repo in Azure DevOps used in my pipelines.

This repo contains three branchs --> master (useless), PreProd and Prod

In pipeline I working on PreProd branch and after deployment I want to perform a task which merging the latest code in PreProd branch into a new commit in Prod.

So, is that possible and how?

Thanks in advance.

3

3 Answers

1
votes

You could try API as @Tomasz suggested, or invoke git command to merge branches.

In addition, you could try Create Pull Request task to create a Pull Request and set Auto Complete:

https://marketplace.visualstudio.com/items?itemName=ShaykiAbramczyk.CreatePullRequest

1
votes

enter image description here

I think you are looking for this.

0
votes

If for some reason GitMerge task is not working for you, try calling Azure DevOps API for Git operations directly from script.

Doc: https://docs.microsoft.com/en-us/rest/api/azure/devops/git/merges/create?view=azure-devops-rest-6.0