Search code examples
gitazure-devopsgit-commitpull-request

What happens to commits between the pull the request and approval


Suppose my feature branch is from the develop branch. I make some commits into feature and submit pull request to my boss to merge into develop.

But if I continue to work on, commit and push to feature before he reviews the request, then will will all those commits be accepted if he accepts the original pull request? In other words, is a pull request meant to merge the latest version of the branch or the specific commit?

Or is it something that depends on specific repositories (gitlab, github etc.)? My company uses azure devops if that is important here.

In this context, I would also want to know how is a pull request different from git merge?


Solution

  • A pull request (also known as merge request) is a request to merge a certain branch (in this case, feature) into another branch (in this case, develop). When a pull request is merged, then all of the changes in the feature branch are merged into the main branch.

    During a pull request, it's in fact normal for the reviewers to spot issues and leave feedback on certain things, which then require additional commits from the reviewee.

    You can configure how you want the feature branch to be merged. For instance, you could choose to have it so the work in the feature branch only appears as one commit, or you can choose to keep the entire history of the branch.

    In this context, I would also want to know how is a pull request different from git merge?

    A pull request is a request to do a git merge, however it allows developers to give feedback on the changes.