Enforce only pull request on visual studio team services
There is any way I could enforce that some people could contribute by one branch only by pull request I want them to be able to accept pull request but not to direct push changes.
This would be useful because we have some branch polices in place that for someone to accept a pull request for example the build must pass. The problem is if we allow someone to accept pull request we would be allowing them to push direct to the branch. There it is any way to give permissions to a branches to only receive changes trough pull request, or at least give permissions to someone to only accept pull requests but not to push directly to the branch.
I need to do that on visual studio online.
What I need it is to remove the permission of someone to direct push commits to a branch without a pull request.
One Solution collect form web for “Enforce only pull request on visual studio team services”
The UI has changed since this question has been asked, the feature is still there:
Yes this is possible with the last release of Visual Studio Online by setting a Git Branch Policy:
To help teams using Git improve the quality of code going into their repo, we’ve added a new capability to set policies on branches. These new policies enable teams to configure requirements for their development branches that are enforced by the server when pushing or merging pull requests. Build breaks can be prevented by using the build policy to require that all changes entering a branch pass a configured build.
Code review policies can be used to set a minimum number of reviewers for pull requests, or even require specific users to review changes made to specific portions of your codebase.