search

Home  >  Q&A  >  body text

Why does Github call code merge requests pull requests instead of push requests?

https://stackoverflow.com/que...

I read the explanation here, but I still feel it’s not convincing enough

My understanding is: I made some changes, and I request to push my changes to your warehouse. Then you review my code. If there is no problem, accept the merge request. This is called a push request. Wouldn't it be more appropriate? Because this operation was initiated by me. Pull is an operation initiated by the warehouse owner to my forked warehouse, so the pull request operation should be initiated by the upstream warehouse owner from me, instead of me actively asking the upstream warehouse owner to pull the code in my warehouse.

三叔三叔2704 days ago1184

reply all(4)I'll reply

  • 黄舟

    黄舟2017-06-20 10:07:54

    That’s right, this should be explained separately.

    This pull refers to the operation of the authority subject. You submitted the code, but you do not have permission to operate the upstream repo. You need the owner of the upstream repo to review your code, and then modify your code and pull it into his repo. This is the explanation for pull.

    And request refers to the action that initiates the subject. In other words, although the owner of the upstream repo has control of the repo and can pull your code changes into his own repo, he will not take the initiative to pull. Instead, you (the initiating subject) need to submit an application, that is, a request, to the owner of the upstream repo, and then the owner of the upstream repo will respond to your request, which is to perform the process of review and pull you call it.

    So, the way to understand the pull request is: a request that notifies the upstream repo owner to pull the code (pull).

    In English, request generally refers to submitting an application and requiring the other party to respond to the application. The modifier before request is the action of the respondent. Of course, it is the same in Chinese. For example, "application for joining a group", after you submit the application, you need to be allowed to join the group before you can be considered a member. Therefore, you do not take the initiative to join the group, but the reviewer adds your name to the group to be considered "joined". In the same way, in "pull request", the request is submitted by you, and pull is what the other party does.

    reply
    0
  • 大家讲道理

    大家讲道理2017-06-20 10:07:54

    In another way of writing, xxx request can be written as "request for xxx", which should be easier to understand.

    The someone in brackets represents the omitted part.

    request (someone) for push, the executor of push is "someone", so this "someone" is you, because it is your push code. If it is request (someone) for pull, then the executor of this pull is the owner of the code base, so it is you who requests someone else pull. Obviously the latter is more in line with the actual situation.

    reply
    0
  • 为情所困

    为情所困2017-06-20 10:07:54

    You have clearly distinguished between active and passive.

    Then the actual problem is that a pull request is when you request the upstream warehouse to pull your code. And if you use push request, you force push the code to the upstream warehouse.

    Actually, push and pull here do not mean whether you did it actively or passively, but whether your code was pushed to it actively by you, or whether your code was pulled by others.

    reply
    0
  • 为情所困

    为情所困2017-06-20 10:07:54

    If you use gitlab. Then its merge request should be much easier for you to understand

    reply
    0
  • Cancelreply