Why does GitHub call foreign submissions, a "Pull Request"?

GitGithubTerminology

Git Problem Overview


I'm curious why GitHub calls submissions to merge, "Pull requests."

From my understanding, git pull will pull all changes, from a remote repository, into a current working branch. Then merge those changes with FETCH_HEAD. (Git Pull)

So taking a look at git push... a push would actually push committed changes to a repository. And isn't that what you are doing with a Git repo? Submitting a "request" to merge your code? So why isn't it called a "Push request"?

Git Solutions


Solution 1 - Git

The term “pull requests” comes from the distributed nature of how many open source projects organize themselves. Instead of just pushing your changes into the repository (like you would do with a centralized repository, e.g. with Subversion), you are publishing your changes separately and ask the maintainer to pull in your changes. The maintainer then can look over the changes and do said pull.

Solution 2 - Git

A pull request is when a contributor that does not have push access to a repository wants to submit code for inclusion in the project. For instance, if you have a project on github and you are the only person with commit rights and I want to include code in your project what do I do?

I'll fork your github repository and create a new branch for my work. Once I'm happy with the current implementation I'll send you a request to git pull my branch into your repository (since I don't have rights to push directly). When you do git pull you have the option of which branch to pull and where you want to pull to. Perhaps you don't want to pull directly into your master branch but into some other branch to examine the code.

The git book has a nice section on different work flows like this.

Solution 3 - Git

When you send your patch to someone else, you want that person to merge your change into his repository. Now, a pull is a fetch and a merge. So, if that person pulls your change, he will have merged it, too, which is what you want.

Solution 4 - Git

When you submit a pull request, you ask the owner of the repo to pull your changes in their local repo (i.e. merge them). Then that repo will be published (via git push) to a public repo but this is implied.

You cannot call this "push request" because nobody pushes your changes, they pull them.

Solution 5 - Git

You push commits from from your private repository to your public repository. You can't however, force changes on someone else's repository, so you request that they pull from your public repository to theirs.

Solution 6 - Git

You don't push directly to a git repo if you are not a maintainer of it.

So, when you want to put your code into it, you create a branch, put it somewhere, and say:

> Hey, here is my branch, please pull it into the main branch!

Instead of:

> Hey, here is my branch, please let me push!

The key of the naming is, you are not the one who do the final action. The maintainer do the last step. So it is the maintainer who pulls your branch in, not you push your branch directly.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionddavisonView Question on Stackoverflow
Solution 1 - GitpokeView Answer on Stackoverflow
Solution 2 - GitasmView Answer on Stackoverflow
Solution 3 - Gitnes1983View Answer on Stackoverflow
Solution 4 - GitwRARView Answer on Stackoverflow
Solution 5 - GitchepnerView Answer on Stackoverflow
Solution 6 - GitSleepyBagView Answer on Stackoverflow