---
title: "ezgh git prs merge"
description: "Merge a pull request."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh git prs merge

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh git prs merge <repo> <number> [--method merge|squash|rebase] [--message text] [flags]
```

Merge a pull request into its base branch, by `--method`: merge (a merge commit), squash (one commit) or rebase (its commits replayed onto the base; refused when they include a merge commit); the default is the first the repository allows. The repository and the base branch's rule decide which methods are allowed and what a merge needs. It merges the head ezgh reads first, or `--expected-head-sha`, and is refused if the pull request moved since.

Part of [`ezgh git prs`](/cli/reference/git-prs).

## Examples

```sh
ezgh git prs merge site 12 --method squash
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--expected-head-sha` | string |  | merge only if this is still the pull request's head commit |
| `--message` | string |  | the merge or squash commit's message |
| `--method` | string |  | merge, squash or rebase (default: the first the repository allows) |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/git-prs-merge/index.mdx
