LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-pull-request

Create pull request from the command line

TLDR

Create a pull request interactively
$ git pull-request
copy
Create a pull request with a title
$ git pull-request -m "[title]"
copy
Create a pull request targeting a specific base branch
$ git pull-request -b [base_branch]
copy
Create a pull request with title and body
$ git pull-request -m "[title]" -m "[body]"
copy
Create a pull request from a specific head branch
$ git pull-request -h [feature_branch] -b [main]
copy

SYNOPSIS

git pull-request [options]

DESCRIPTION

git pull-request creates a GitHub pull request from the command line. Part of the hub CLI tool (by GitHub), it pushes the current branch if needed and opens a pull request to the specified base branch.The command can extract PR title and body from commit messages or prompt for them interactively. When invoked without -m, an editor opens for composing the message. The first line becomes the title, and subsequent lines become the body.Note: The hub tool is now in maintenance mode. The official replacement is gh pr create from the GitHub CLI, which provides more comprehensive GitHub integration.

PARAMETERS

-m, --message text

PR title/message. Use twice to set title and body separately.
-b, --base branch
Target base branch for the pull request.
-h, --head branch
Source head branch (defaults to current branch).
-i, --issue number
Convert an existing issue into a pull request.

SEE ALSO

Copied to clipboard
Kai