---
title: Mergify Backport Command
description: Copy a pull request to another branch after merge.
---

The `backport` command is especially useful for projects that maintain
multiple branches simultaneously. It automates the process of creating a new
pull request to apply changes from a merged pull request onto another branch,
whether you're maintaining different versions of your software or need to ensure
that bug fixes are propagated to all active branches.

Once the backport is initiated, Mergify will provide feedback directly in the
comments. If the backport is successful, you'll receive a link to the newly
created pull request. If there are issues, Mergify will provide a brief
description of the problem.

If Mergify encounters merge conflicts during the backport process, it will
create a pull request with the conflicts. You'll need to manually resolve these
conflicts within GitHub.

The `backport` command is especially handy for:

- **Version Maintenance**: Quickly propagate bug fixes to older, maintained
  versions of your software.

- **Feature Parity**: Ensure that features developed on a mainline branch are
  also available on other active branches.

:::note
This command is also [available as an action](/workflow/actions/backport).
:::

:::tip[Tips]
  - Always review the generated backport pull request before merging, to ensure
    that the changes are compatible with the target branch.

  - If you anticipate a challenging backport due to major differences between
    branches, consider manually preparing the branch before invoking the
    `backport` command.
:::

## Syntax

```text
@Mergifyio backport <target-branch> [<another-target-branch>] […]
```

## Parameters

- `<target-branch>`: The name of the branch to which the changes should be
  backported.

<BackportLimitations />

## Example

Suppose you have a pull request that was merged into `main`, but you also want
to apply these changes to a branch named `v2.0-stable`. You would use the
command as follows:

```text
@Mergifyio backport v2.0-stable
```

Upon executing this command, Mergify will attempt to automatically create a new
pull request with the changes onto the `v2.0-stable` branch as soon as the
original pull request is merged.
