Ganesh
Ganesh

Reputation: 123

Azure devops Pull request do not merge commits from someone else

I have one branch which we are using for development. Team raise PR to merge the changes in master branch.

User 1 raise PR -> Dev to Master Checks validation is in progress Build in progress

User 2 commit other changes Now these changes would get merge into the above PR itself.

We want to restrict this behavior. We want separate PR for separate user and want to get those merged into the separately.

Upvotes: 0

Views: 1229

Answers (1)

JukkaK
JukkaK

Reputation: 1175

Adapt a feature/topic branch workflow, so that the developers work in isolation in their own feature branches and do PR:s to either develop or master -branch (depending on if you need to isolate the whole sum of work from main branch). Protect the branch that developers merge PRs into with branch policies.

For example:

https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows

If you then need to do PR's from develop to master for certain changes only, you can cherry pick the original pull request, which in essence creates a new topic branch a pull request from it to master. But that tends to get rather tiresome soon.

https://learn.microsoft.com/en-us/azure/devops/repos/git/cherry-pick?view=azure-devops&tabs=visual-studio

Upvotes: 1

Related Questions