Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/content/docs/commands/copy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Mergify Copy Command
description: Copy a pull request to another branch.
---

import CopyLimitations from '../workflow/actions/_copy_limitations.mdx';

The `copy` command is a convenient tool in Mergify's suite, allowing users to
replicate changes from a pull request to another branch within the same
repository. This is particularly useful for teams working with multiple
Expand Down Expand Up @@ -51,6 +53,8 @@ The `copy` command is especially handy for:

- `<target-branch>`: The destination branch within the same repository.

<CopyLimitations />

## Example

Assume you have made changes in a pull request targeting the `feature-x` branch
Expand Down
14 changes: 14 additions & 0 deletions src/content/docs/workflow/actions/_copy_limitations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Limitations

:::caution
Pull requests containing merge commits cannot be copied (except for
merges of the base branch).
:::

Mergify cannot copy a pull request that contains a merge commit, such as
when you merge a teammate's branch into yours. Merges of the base branch into
your pull request (for example, `Merge branch 'main'`) are an exception and
don't block the copy.

To avoid this, rebase your pull request or squash its commits so its history
stays linear.
3 changes: 3 additions & 0 deletions src/content/docs/workflow/actions/copy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Copy a pull request to another branch.
---

import ActionOptionsTable from '../../../../components/Tables/ActionOptionsTable';
import CopyLimitations from './_copy_limitations.mdx';

The `copy` action enables you to automatically create a copy of a pull request.
When the conditions you specify are met, Mergify will create a new pull request
Expand Down Expand Up @@ -46,6 +47,8 @@ On top of that, you can also use the following additional variables:
- `{{ cherry_pick_error }}`: the cherry pick error message if any (only
available in body).

<CopyLimitations />

## Examples

### Using Labels to Copy
Expand Down