A "pull request" isn't a concept in the Git object model.
A pull request is an offer of some new code to a project. Essentially, "please merge the changes I made into your project's stream".
"Creation of a pull request" isn't a Git operation, though Git has a request-pull
command which summarizes some changes into a textual message.
The git pull
command fetches objects from a remote repository (like git fetch
) and then performs a git rebase
or git merge
, depending on which action is configured as a the default.
You might be confusing Git, the version control tool with the facilities of some project hosting site based around Git (whose "pull requests" might not be based on using the output of git request-pull
at all.).
git pull
and "pull request" are completely different things. In fact, you wouldn't want to fullfill someone's request to add code to your project by doing a blind git pull
from their repository.
As a general rule of thumb, if you want to make it as easy as possible for someone to incorporate some patches you have made to their project, it behooves you to rebase those changes to their latest codebase, so that they cleanly apply on top without any merging. Project maintainers generally don't want to hear, "I made some changes based on a copy of your project I retrieved back in 2011; can you merge them for me?"
However, if you tell someone you have some changes at a specific GIT repo you'd like them to use, identified by SHA commit hashes, and then you rebase those changes, that person effectively has a stale request which points to the old, un-rebased version of your changes.
Git has a command request-pull
which is basically a query that creates a pull request, which is just a textual message identifying and summarizing some changes. The command also performs a sanity check that the advertized range of changes is actually available at the given git URL, which catches you if the URL is incorrect, or you didn't push the changes there yet (you're accidentally advertizing a pull request out of some unpublished changes in a local repo).