# gh pr merge

Merge a PR, your way.

## Quick answer
```
gh pr merge 123 --squash --delete-branch
```

## Syntax
```
gh pr merge [<number> | <url> | <branch>] [flags]
```

## Examples

# Merge the current branch's PR interactively
gh pr merge

# Squash and delete the branch
gh pr merge 123 --squash --delete-branch

# Rebase merge
gh pr merge 123 --rebase

# Auto-merge as soon as required checks pass
gh pr merge 123 --squash --auto

# Set the squash commit subject
gh pr merge 123 --squash --subject "Add caching layer"

## Key flags

  -m, --merge	Create a merge commit.
  -s, --squash	Squash all commits into one, then merge.
  -r, --rebase	Rebase the commits onto the base branch.
  --auto	Merge automatically once all requirements are met.
  -d, --delete-branch	Delete the local and remote branch after merge.
  --admin	Use admin privileges to merge past failing or pending checks.
  -t, --subject	Commit subject for the merge or squash commit.
  --body	Commit body text.

Full guide: https://ghcli.com/gh-pr-merge.php
