之前用 SAE
的时候学了点 svn
,后来发现还是 Git
先进,再后来就把注册许久不用的 Github
账号拿出来捣鼓,结果对 pull request
很迷惑。
Update:
[上一秒] pull 不是拉么?怎么地想也感觉是 push request 才对。
[下一秒] 哦!对作者来说是 pull 。。。
那就是两者一点都不搭边咯,一个是 CLI
的命令,一个是 Github
上概念性的东西。
仅有的幸福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-pull
Github.
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):
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
request, the subcommand is actually executed behind the scenes. The (main) signature of this subcommand is as follows:
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 eachbash
$ git request-pull <start> <url> [<end>]
pull request, so you can see the corresponding commit, time, author and other information.
git pull
去指定地址(包含在 git request-pull
If the upstream author chooses to accept the
after receiving it, Github will call git pull
to pull the code at the specified address (included in the information generated by
世界只因有你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.