dawid
dawid

Reputation: 788

Trying to understand the workflow of a "pull request": why are they called this way?

As far as I could understand, if one wants to contribute code to a repository, one would clone/pull and edit. After that, one would push the changes to, e.g. github. Aren't they actually "pushes"?

Upvotes: 3

Views: 206

Answers (4)

Obsidian
Obsidian

Reputation: 3897

Aren't they actually "pushes"?

Actually, pushing consists of transmitting by yourself an information to people around that could need it, while pulling is about fetching the information YOU need and bring it to you.

Since you generally don't have the right to directly write into a public repository, you make your changes available somewhere then ask the maintainer to pull them by himself into his repository. Thus the "pull request".

Upvotes: 1

phd
phd

Reputation: 94453

Pull requests is a Github's term. At Gitlab, for example, they are called Merge requests.

Pull requests are named after git's own git request-pull.

Upvotes: 4

Julian
Julian

Reputation: 36710

If you like to send a contribution to a GitHub repository, it would be easy to just push it to the repository.

But if everyone just pushes code into one repository, it could get a mess. So therefor you ask the owner to get (and check) your changes, and he pulls the changes from your repository into his repository.

Upvotes: 2

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521103

To answer your question, we can look at the physics of what actually happens during a pull request. Let's say that you have some feature branch which is ready to be merged back to master in GitHub. The direction of code flow during the pull request is from your feature branch to the master branch. So, from the point of view of the master branch, the opposite of pushing is happening, which is pulling. That is, if the master branch were sending code somewhere, it would be pushing, but it is receiving/asking for code from the feature branch, so we call it a request to pull, or a pull request.

Upvotes: 3

Related Questions