Do I have to open pull request every time?

Viewed 838

Working with Azure DevOps, I create a branch out of Dev branch.

When I open a pull request, it includes all the commits from the Dev branch.

Do I need to open a pull request even on opening a new branch?

This way it will give me the option to open a "clean" pull request only with my newly added files,

But is it the only way to get "Clean" pull requests?

1 Answers

Do I need to open a pull request even on opening a new branch?

The answer is no.

As we know, the Pull request could:

let your team review code and give feedback on changes before merging it into the master branch. Pull requests can come from either topic branches within the same repository or from a branch in a fork of the original repository. Reviewers can step through the proposed changes, leave comments, and vote to approve or reject the code.

With pull request, the code in the branch are protected. When we opening a new branch out of Dev branch, lets call it feature branch without any modification, we do not need to open a pull request, that because there is no any new change in the new feature branch.

enter image description here

This way it will give me the option to open a "clean" pull request only with my newly added files

If we create the feature branch based on Dev branch, make any change on the feature branch, then create pull request to merge feature branch to Dev branch, it only include newly added files:

enter image description here

But if merge feature branch to other branch, not the Dev branch, it will not only include newly added files.

Hope this helps.

Related