What are the relations between git pull-request
and git pull
and git push
?
Suppose I and other peers share a remote repository. Each of us has an individual local repository.
When I finish working on a feature in my local repository, I would like to share my work with my peers.
- Shall I use
git pull-request
to ask my peers togit pull
from my local repository to their individual repositories? Shall I run
git pull-request
with the shared remote repository as its URL argument? If yes, does the command ask the administrator of the shared remote repository togit pull
from my local repository to the remote repository? The following three sources seem to say yes.The manpage of
git pull-request
says it "Generate a request asking your upstream project to pull changes into their tree."https://stackoverflow.com/a/49432466/10082400 says after someone runs
git request-pull
, "...Linus can then git pull directly from this other repository, or more likely, git fetch from there and decide whether and how to merge them"https://github.com/torvalds/linux/blob/master/Documentation/process/submitting-patches.rst#16-sending-git-pull-requests says "if you have a series of patches, it may be most convenient to have the maintainer pull them directly into the subsystem repository with a git pull operation."
Do I need to
git push
my work on the feature from my local repository to the shared remote repository before I rungit request-pull
?Why do I need to, if
git request-pull
will request the administrator of the shared remote repository to pull my work on the feature from my local repository to the shared remote repository?The manpage of
git pull-request
gives an example, whichgit push
beforegit pull-request". Is
git pushnecessary before
git pull-request` in the example?Imagine that you built your work on your master branch on top of the v1.0 release, and want it to be integrated to the project. First you push that change to your public repository for others to see:
git push https://git.ko.xz/project master
Then, you run this command:
git request-pull v1.0 https://git.ko.xz/project master
which will produce a request to the upstream, summarizing the changes between the v1.0 release andyour master , to pull it from your public repository.