> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/devops/code/branch-actions/using-smart-merge.md).

# Using Smart Merge

{% hint style="warning" %}

#### Written for the Old UI

This article was written for the old UI. The instructions are still usable, but the screenshots are outdated. In some cases, items referenced in the instructions have moved or changed. If you cannot find an item, see the [Where Did It Go](/devops/new-ui-ux-transition/where-did-it-go.md) article.
{% endhint %}

## ![](https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FG5ZbxX918xOHwbAwAJ4n%2FSummary2-Small-Icon.svg?alt=media\&token=da26a67f-ff7f-47b3-8669-06be960dc2d7) Overview

In DevOps, Smart Merge lets you quickly merge changes from a Source branch into a Target branch. This article walks you through how to perform a Smart Merge step by step. These instructions don’t cover Smart Merges with conflicting changes; to learn how to resolve conflicts, see the following article.

* [Resolving Smart Merge Conflicts](/devops/code/branch-actions/resolving-smart-merge-conflicts.md)

{% hint style="info" %}

#### Smart Merge vs Pull Request

Smart Merge and Pull Request both merge changes from a source branch into a target branch, but each suits a different workflow.

**Smart Merge** is a streamlined, single-step process that merges changes directly between branches without requiring a Pull Request or team approval. It works well for time-sensitive situations, such as urgent fixes or critical changes that need to ship quickly.

A **Pull Request**, by contrast, is a structured, multi-step process built for team collaboration. It lets multiple reviewers inspect the changes, request revisions, and formally approve them before merging.

As a general rule, use a Pull Request when changes need oversight or sign-off from other team members, and choose Smart Merge when you need to integrate changes quickly.
{% endhint %}

To learn more about Pull Requests, see the following article.

* [Overview of Pull Requests](/devops/pull-requests/overview-of-pull-requests.md)

## Run Smart Merge

{% stepper %}
{% step %}

### Select Source Branch and Run Smart Merge

1. Click **Code** from the left sidebar menu.
2. Select the branch from the list to use as the source branch for the merge.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FrKUpxKRuETJK7nFbWdHZ%2FUsingSmartMerge-S01-01.png?alt=media&amp;token=7ed3383a-d3a1-45a6-b7a3-041ebc1cb609" alt="" width="563"><figcaption></figcaption></figure></div>
3. Click the **Three Vertical Dots ⋮** dropdown menu next to Deploy.
4. Click **Smart Merge**.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FOZsUODLrFCPo2Rz5pflf%2FUsingSmartMerge-S01-02.png?alt=media&amp;token=7cac0837-eee2-4931-a574-3607113cfca8" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Select Target Branch

1. Click **Select** for the branch you want to be the target of the merge.
2. Click **Next**.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FlTYWftE0aA7jW9t7YVyX%2FUsingSmartMerge-S02-01.png?alt=media&amp;token=e42245b2-e92b-46c6-a3d4-5eacd43af3ef" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Resolve Conflicts

After you select the target branch, Smart Merge compares the two branches to identify changes it cannot merge automatically. When the check finishes, you will be notified whether the branch can be merged or whether you must resolve conflicts first. If there are no conflicts, skip this step and continue to **Review Changes**.

<div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FxUAzNqXiFaXsnaat3KVS%2FUsingSmartMerge-S03-01.png?alt=media&amp;token=e9d7643b-a8d0-4716-ba19-d4e04260d357" alt="" width="563"><figcaption></figcaption></figure></div>

To resolve Smart Merge conflicts, you can **Retain Target Changes** or **Overwrite Target Changes** for each change to achieve the desired outcome. The following article explains the process in detail.

* [Resolving Smart Merge Conflicts](/devops/code/branch-actions/resolving-smart-merge-conflicts.md)
  {% endstep %}

{% step %}

### Review Changes

Once any conflicts are resolved, you must review the changes to each component with the **Component Diff Viewer**. All components with changes are listed in the **Components with Changes** list on the left. Clicking a component opens it in the Diff Viewer so you can review the changes.

<div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FTeSlFFXY8eJ8cpfvAC4A%2FUsingSmartMerge-S04-01.png?alt=media&amp;token=67877fcc-1b21-40a7-9590-b634a0635fa2" alt="" width="563"><figcaption></figcaption></figure></div>

1. To review a component's changes, select it from the **Components with Changes** list on the left.

{% hint style="warning" %}
All components should be reviewed.
{% endhint %}

2. When reviewing a component, the source code for **Target** and **Source** is displayed side by side, with differences highlighted.
   1. **Red**: Lines to be removed.
   2. **Green**: Lines to be added.

      <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FxBpElffmwgvYyVU2RUot%2FUsingSmartMerge-S04-02.png?alt=media&amp;token=2d8dd8b2-dee2-4b02-85a6-b600a3de6928" alt="" width="563"><figcaption></figcaption></figure></div>
3. Repeat the review process for each component.

{% hint style="info" %}
If there are any changes from the source that you do not want to merge into the target, you must cancel the merge and make the changes in the source. Once the changes are made, you can start the merge again.
{% endhint %}
{% endstep %}

{% step %}

### Merge Changes

Once all changes are reviewed, you can merge the source branch into the target branch.

1. Click **Merge**.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FOVImSz0EYSHbB0qz6NFH%2FUsingSmartMerge-S05-01.png?alt=media&amp;token=a0aae933-b8c5-43c1-b4bf-cb77b23beaca" alt="" width="563"><figcaption></figcaption></figure></div>
2. Once the **Merge** job starts, you will be taken to the branch **Activities** tab, where you can check the job's status.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FOsD2oih6XN93ywUL3uAi%2FUsingSmartMerge-S05-02.png?alt=media&amp;token=9923f67e-f387-4e62-8c94-e3f86b5e9fb5" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
The **Merge** job appears on the **Activities** tab for both the target and source branches.
{% endhint %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flosum.com/devops/code/branch-actions/using-smart-merge.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
