Why is a git 'pull request' not called a 'push request'?

The terminology used to merge a branch with an official repository is a 'pull request'. This is confusing, as it appears that I am requesting to push my changes to the official repository.

Why is it called a pull request and not a push request?


"Push" is you forcing the changes being present in the target repository. "Pull" is the target repository grabbing your changes to be present there.

A "pull request" is you requesting the target repository to please grab your changes.

A "push request" would be the target repository requesting you to push your changes.


When you send a pull request, you're asking (requesting) the official repo owner to pull some changes from your own repo. Hence "pull request".


tl;dr since I am not allowed to make a push, I'll just nicely make a request to the repo owner so they decide to pull


Who can push code to a repository?

Should anyone (possibly evil or uneducated or unknown) be able to come and say here I just pushed this to your master branch and messed up all your code HAHAHA! ?

Surely you don't want him to do that. By default a safety net is set so no one can push to your repo. You can set others as a collaborator, then they can push. You would give such access to people you trust.

So if you're not a collaborator and try to push, you will get some error indicating you don't have permission.


So how can other developers push to a repo they are not given permission to push?
You can't give access to everyone, yet you want to give others an outlet/entry point so they can make 'a request to the repo owner to pull this code into the repo'.

At the end they make that pull request from their fork and the owner will decide whether or not to merge the request.

链接地址: http://www.djcxy.com/p/48974.html

上一篇: TeamCity Git插件失败,出现SSL握手错误

下一篇: 为什么git'pull request'不叫'推送请求'?