search

Home  >  Q&A  >  body text

`Github` 上的 `pull request` 与 `Git` 的 `pull` 有关系么?

之前用 SAE 的时候学了点 svn,后来发现还是 Git 先进,再后来就把注册许久不用的 Github 账号拿出来捣鼓,结果对 pull request 很迷惑。

Update:
[上一秒] pull 不是拉么?怎么地想也感觉是 push request 才对。
[下一秒] 哦!对作者来说是 pull 。。。

那就是两者一点都不搭边咯,一个是 CLI 的命令,一个是 Github 上概念性的东西。

PHPzPHPz2795 days ago783

reply all(2)I'll reply

  • 仅有的幸福

    仅有的幸福2017-04-28 09:08:25

    Let me be more clear. The previous answers and discussions are specious and do not point to the truth.

    pull request and on git pull 并非完全没有关系,不过和它关系最近的则是另外一个命令 git request-pullGithub.

    Let’s talk about the conceptual explanation first. Maybe most people (including the subject) will understand it this way pull request

    I submit a pull request to integrate my changes into upstream (which usually represents the source of your fork)

    In this case, it feels like push request is the most appropriate, because this action is entirely my initiative!

    However, this understanding ignores a premise: Do you have the permission to push to upstream? In other words, can you write upstream directly?

    This is divided into two situations (corresponding to two Git-based workflows):

    1. You have permission - then you don’t need to fork & pull request. Since the author has given you permission, you can just clone it and operate it as your own repo. Why bother?
    2. No permission - Since there is no permission, how can I push request?

    Ultimately, this misunderstanding stems from not fully understanding how the pull request workflow works. The correct description of the pull request action should be like this:

    I initiate a request (in the case of Github, it is an HTTP request that calls the corresponding API, and then Github executes it on the backend git request-pull, see below for details), this request (request in HTTP request) is a request (pull request in request)The upstream author pulls(pull in pull request)from the changes in my fork.

    This is the correct understanding.

    Finally, let’s talk git request-pull。当你做出 pull request 请求的时候,其实背后执行的是 git request-pull. When you make a

    pull request

    request, the subcommand is actually executed behind the scenes. The (main) signature of this subcommand is as follows:

    bash$ git request-pull <start> <url> [<end>]
    

    This command generates a summary that contains the change record (in commits) and the address used to fetch these changes. The summary is output to stdout in fixed-format plain text, which you can redirect and write code for subsequent processing. This is how Github analyzes each

    pull request, so you can see the corresponding commit, time, author and other information. git pull 去指定地址(包含在 git request-pullIf the upstream author chooses to accept the

    pull request

    after receiving it, Github will call git pull to pull the code at the specified address (included in the information generated by

    ). The upstream author naturally has permission to write to the upstream repo, so a complete process can be realized. 🎜 🎜It is recommended to read the official Git manual, especially this chapter: Distributed Git - Contributing to the project. I guarantee you will benefit a lot after reading it. 🎜

    reply
    0
  • 世界只因有你

    世界只因有你2017-04-28 09:08:25

    It’s a public library, right? You pull your modifications to this library, and then the author of this library can see your request and decide whether to merge you into his original library.

    reply
    0
  • Cancelreply