Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 CLI Documentation | 2025.2

# p4 merge (graph)

Merge another branch into the current or target branch.

## Syntax

    p4 merge [options] source-branch
    p4 merge [options] --repo=//repo/name --target=branch source-branch0 [source-branch1 ...]
    p4 merge [options] --repo=//repo/name:target:source0[:source1...]

Syntax and naming conventions

## Description

Merges commits from the source branch into this branch, typically creating a merge commit.

### Interactive mode

`p4 merge [options] source-branch`

In this mode, a `graph` client is required that maps to a single repo and the target branch is the branch to which the client is currently synced.

### Non-interactive mode

`p4 merge [options] --repo=//repo/name --target=branch source-branch0 [source-branch1 ...]`

The `--repo` flag specifies that the merge is a non-interactive clientless merge to be performed on the server. This requires a `--target` branch to merge to.

### Atomic non-interactive mode

`p4 merge [options] --repo=//repo/name:target:source0[:source1 ...] ...`

In the atomic non-interactive mode, a clientless merge is performed on the server and involves multiple repos.

Specify the `--repo` flag repeatedly with the single target branch and one or more source branches separated with a colon (`:`) character.

## Options

Option | Description
--- | ---
`-d description` | The default description is `Merge into <target> <source>` by default.
`--ff-only` | Refuse to merge unless the current branch head is already up-to-date or the merge can be resolved as a fast-forward.
`--no-ff` | Create a merge commit even if it resolves as a fast-forward.
`--squash` | Perform a merge without a merge commit (single parent).
`-n` | Preview the merge.

Your search for returned results