Forrest logo
back to the gh tool

gh-pr-merge:tldr:12597

gh-pr-merge: Merge the current pull request with the specified merge strategy.
$ gh pr merge --${select}
try on your machine

The command gh pr merge --${select} is used in the context of the GitHub CLI (Command Line Interface) to merge a pull request (PR) on GitHub.

Here's a breakdown of each component of the command:

  • gh: This is the command itself, indicating that you are using the GitHub CLI.

  • pr merge: This specifies the action you want to perform, which is to merge a pull request.

  • --${select}: This portion of the command represents an option for the pr merge action. The ${select} is a placeholder, indicating that you need to replace it with an actual value. The value you provide here determines which pull request(s) to merge.

For example, if you want to merge a specific pull request with a known number, you would replace ${select} with the number of the PR.

So, if you have a pull request with the number 42, the command would become:

gh pr merge -- 42

This would merge the pull request with the number 42.

Note: The '--' before the PR number separates the options from the following arguments. It is required to ensure that the value you provide after the '--' is interpreted correctly as the pull request number.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gh tool