Forrest logo
back to the gh tool

gh-pr-merge:tldr:f7d98

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

This command is executed to merge a pull request (PR) using the GitHub CLI (gh). Here's a breakdown of the command:

  • "gh pr merge": This is the base command to merge a pull request.
  • "--${select}": This option is used to select the merge method. The ${select} is a placeholder for a specific merge method like create, rebase, squash, or fast-forward. For example, if you have a variable named $select with a value of rebase, then your command would be gh pr merge --rebase. This option determines how the changes are merged with the target branch.
  • "--subject ${commit_message}": This option is used to set the commit message for the merge. The ${commit_message} is also a placeholder for the actual commit message you want to use. Replace ${commit_message} with your desired merge commit message. This is helpful for providing specific information about the merge.

To use this command, replace ${select} with the desired merge method (e.g., rebase) and replace ${commit_message} with your preferred commit message.

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