LinuxCommandLibrary

git-request-pull

Generate request to pull changes

TLDR

Produce a request summarizing the changes between the v1.1 release and a specified branch

$ git request-pull [v1.1] [https://example.com/project] [branch_name]
copy

Produce a request summarizing the changes between the v0.1 release on the foo branch and the local bar branch
$ git request-pull [v0.1] [https://example.com/project] [foo:bar]
copy

SYNOPSIS

git request-pull start url [end]

PARAMETERS

start
    The starting point of the range of commits to include in the request. Usually this is the branch you diverged from.

url
    The URL of the repository where you want the changes to be pulled. This is the recipient's repository.

[end]
    The endpoint of the range of commits to include in the request. If omitted, it defaults to HEAD.

DESCRIPTION

The git request-pull command generates a summary of pending changes, along with a URL suitable for creating a pull request on a remote repository. It's designed to be used after you've made commits on a branch and want to ask someone to merge them into their repository. The command compares the specified branch with another branch (usually the 'master' or 'main' branch of the repository you want to merge into) and produces a nicely formatted message. This message includes a list of the changes, commit summaries, and instructions on how the recipient can pull those changes into their own repository.

The generated output includes a 'git pull' command that the recipient can directly use to fetch and merge your changes. It is primarily intended to be shared via email or other communication channels, making it easy for others to review and integrate your work.

The primary use of the command is to create formatted messages that can be sent to maintainers or collaborators, simplifying the process of submitting contributions to open-source projects or working within distributed teams. The message generated by this tool simplifies the pull request process by including essential data in the body of the request.

CAVEATS

The URL must be a valid Git URL that can be used with `git fetch`. It assumes that the recipient has push access to the repository specified by the URL.

USAGE EXAMPLE

To create a pull request for the 'my-feature' branch against the 'origin/master' branch of the repository at 'git://example.com/project.git', you can use the following command:

`git request-pull origin/master git://example.com/project.git my-feature`

This will generate a formatted message including commit summaries and a 'git pull' command that can be sent to the project maintainer.

HISTORY

The git request-pull command has been part of Git since its early days, providing a convenient way to generate pull request information before web-based pull request platforms became ubiquitous. It originated as a way to streamline collaboration in a distributed environment where contributors would email patches or pull requests to maintainers. While web-based pull requests are now more common, the tool is still useful for generating standardized pull request messages, especially in workflows that involve email-based patch management.

SEE ALSO

git format-patch(1), git send-email(1), git pull(1), git fetch(1)

Copied to clipboard