---
title: "Merge"
description: "Configure merge conditions with regex for source, target branches, or release. Evaluate nodes merging across branches. (Gitana 4.0)"
product: "Gitana"
version: "4.0"
url: "/documentation/gitana/4.0/engine/behaviors/conditions/merge"
---

# Merge

The `merge` condition tests whether the given node is being merged. A configuration can be provided that can test whether the node is being merged from a specific source branch or to a specific target branch. It can also test whether the merge is part of a Release.

The following properties are supported:

- `sourceBranchId`
- `sourceBranchTitle`
- `targetBranchId`
- `targetBranchTitle`
- `releaseId`
- `releaseTitle`

Each of these properties supports Regular Expression matching.

The condition will evaluate to `true` if all of the specified properties are matched.

If no configuration is provided, then the condition will evaluate to `true` to indicate that the node is being merged (from anywhere and to anywhere).

## JSON Schema

```
{
    "title": "Merge",
    "properties": {
        "sourceBranchId": {
            "type": "string",
            "title": "Source Branch ID"
        },
        "sourceBranchTitle": {
            "type": "string",
            "title": "Source Branch Title"
        },
        "targetBranchId": {
            "type": "string",
            "title": "Target Branch ID"
        },
        "targetBranchTitle": {
            "type": "string",
            "title": "Target Branch Title"
        },
        "releaseId": {
            "type": "string",
            "title": "Release ID"
        },
        "releaseTitle": {
            "type": "string",
            "title": "Release Title"
        }                                        
    }
}
```

## Example #1

Suppose you wanted a rule to only trigger if the node in question is being written as part of a merge. That's easy.  
You can simply do something like this:

```
{
    "type": "merge"
}
```

## Example #2

Here is a condition that triggers when the node is being merged from a source branch with a specific ID.

```
{
    "type": "merge",
    "config": {
        "sourceBranchId": "8145944078a7f223ebde"
    }
}
```

## Example #3

Here is a condition that triggers when the node is being merged to a target branch with a specific name:

```
{
    "type": "merge",
    "config": {
        "targetBranchTitle": "Live Branch"
    }
}
```

## Example #4

Here is a condition that triggers when the node that is being merged is part of a specific release (identified by a regular expression on the title):

```
{
    "type": "merge",
    "config": {
        "releaseTitle": ".*-PROD-.*"
    }
}
```
