---
title: Mergify Squash Command
description: Squash the commits of a pull request into one.
---

The `squash` command condenses all the changes from a pull request into a
single commit. For PRs that come with many incremental commits, it keeps the
commit history neat and concise, especially when you wish to merge a pull
request without the clutter of multiple individual commits.

The `squash` command is useful for:

- **Clarity and Neatness**: Maintaining a clean commit history, especially when
  numerous commits have only minor changes.

- **Simplified Review**: When reviewers prefer seeing the entirety of changes
  in one commit, making the review process more straightforward.

## Syntax

```text
@Mergifyio squash [<commit message format>]
```

## Parameters

- `commit message format` defines what commit message to use for the squashed
  commit. Possible values are:

  - `all-commits` to use the same format as GitHub squashed merge commit
    (default).

  - `first-commit` to use the message of the first commit of the pull request.

  - `title+body` means to use the title and body from the pull request itself
    as the commit message. The pull request number will be added to end of the
    title.
