Git Reference ยท Remotes and Collaboration
git request-pull command
Reference for git request-pull: print a plain-text summary of changes between a base and your tip, with the URL to fetch them from, ready to email to a maintainer.
git request-pull prints a plain-text message that asks someone to pull your changes. It lists the base commit, the URL and ref where your work can be fetched, the commits in between, and a diffstat. The Linux kernel and other mailing-list projects use it as the email equivalent of a hosting site's "pull request" button.
The command only writes the text. It does not send anything and does not publish your commits: you must push the branch to the public URL first.
git request-pull [-p] <start> <url> [<end>]
Try it
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.
Syntax
| Name | Description |
|---|---|
<start> |
The commit your work is based on, usually a tag or a remote-tracking branch such as origin/main. Everything after it is described. |
<url> |
The public repository URL where the maintainer can fetch your commits. It is only printed; the command also contacts it to check the ref. |
<end> |
The branch or tag to describe, as named in the remote. Defaults to HEAD. A form local:remote handles differing names. |
-p |
Also print the patch text after the diffstat. |
Output: text on standard output: the header (The following changes since commit ...), the fetch URL and ref, a signature-like list of the commits, then a diffstat.
Errors: if the commit at <end> is not found at <url> (not pushed, or pushed under a different name), the command prints warn: No match for commit ... found at ... and warn: Are you sure you pushed ...? to standard error. It still prints the summary, but exits with a non-zero status, so scripts can detect the problem. An unknown <start> or <end> revision is a plain error.
Usage notes
- Push first. The check uses the remote's advertised refs, so the URL must be reachable and already contain the branch.
- Tags are the usual choice on large projects. If
<end>is an annotated (often signed) tag, the message includes the tag's text and the fetch line names the tag instead of a branch. - Stable base. Use a tag or release for
<start>. A moving branch name changes the summary every time you rerun. - Plain text only. Paste the output into an email body; use git send-email for patches and a cover letter.
- Not the hosting site's feature. Services such as GitHub build pull requests from their own data and do not use this command.
- For reviews that want patches, git format-patch is the alternative: the maintainer reads each commit as an email.