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-requestto ask my peers togit pullfrom my local repository to their individual repositories? Shall I run
git pull-requestwith the shared remote repository as its URL argument? If yes, does the command ask the administrator of the shared remote repository togit pullfrom my local repository to the remote repository? The following three sources seem to say yes.The manpage of
git pull-requestsays 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 pushmy 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-pullwill 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-requestgives an example, whichgit pushbeforegit pull-request". Isgit pushnecessary beforegit 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 masterThen, you run this command:
git request-pull v1.0 https://git.ko.xz/project masterwhich will produce a request to the upstream, summarizing the changes between the v1.0 release andyour master , to pull it from your public repository.
git pull-request. You should all justpushandpullform one repo. Pull requests are only useful in a collaborative environment where you don't trust the people committing, so need to check their commits before merging them in, etcpull-requestsare for merging between remote repositories (forks)git request-pulltells others that you have created a branch from a revision and made some new commits, and where they can get this new branch if they need these commits. If they need one or some or all of these commits, they can fetch the branch from the repository and then apply as many commits as they need, bygit merge,git rebase,git cherry-pick, etc. The branch may be a real branch likerefs/heads/fooor a ref likerefs/changes/22.