# Using Branch Overwrite Protection

## ![](/files/RXx59Hu9EyPCisSQ0YzA) Overview

Overwrite Protection helps prevent accidental overwrites by comparing branch components with those in your live org. It highlights components that are new, different, or the same, ensuring that critical metadata remains intact during deployment. This guide explains how to run an Overwrite Protection job, review the results, and address any differences.

{% hint style="info" %}

#### **Best Practices**

* Always run **Overwrite Protection** before deploying to production or critical environments.
* Focus on **Different** components — review carefully before deciding which version to keep.
* Use meaningful **commit messages** when finalizing resolutions, so your team can track the reason for changes.
* Resolve conflicts in the Overwrite Protection UI rather than skipping them — this keeps your branch and org in sync.
* If the job fails or ends with an **Exception**, check the logs immediately and rerun once fixed.
* Combine **Overwrite Protection** with **Pre-Deploy Fix** to catch both overwrites and missing dependencies before deployment.
  {% endhint %}

## Run Overwrite Protection Job

{% stepper %}
{% step %}

### Select a Branch and Start Overwrite Protection

1. Click **Code** from the left sidebar menu.
2. &#x20;Select a branch from the list.&#x20;

   <div align="left"><figure><img src="/files/l79LVVLcF6Ofx6AQA9jr" alt="" width="563"><figcaption></figcaption></figure></div>
3. Click the **Three Vertical Dots ⋮** dropdown menu next to Deploy.
4. Click **Overwrite Protection**.&#x20;

   <div align="left"><figure><img src="/files/G3BFISQgpcQqoQ8cEUww" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Select a Connection and Components

{% hint style="info" %}
Use the **Search**, **Filter**, and **Sort** options to help you find the correct connection and components.
{% endhint %}

1. Click **Select** for the Salesforce org Connection to check for overwrites.
2. Click **Next**.&#x20;

   <div align="left"><figure><img src="/files/ahMUK4pro0tLH3qGMf06" alt="" width="563"><figcaption></figcaption></figure></div>
3. Click **Add** for each component to check for overwrites.&#x20;
4. (Optional) Click **Add All** to include all components. **Note:** The search, filter, and sort options don't limit which components are added with the **Add All** button.
5. Click **Run**.&#x20;

   <div align="left"><figure><img src="/files/47pkRHhUF1OMI8PLd954" alt="" width="563"><figcaption></figcaption></figure></div>
6. After starting the Overwrite Protection job, it will be displayed on the **Activities** tab.&#x20;

   <div align="left"><figure><img src="/files/EhWF0owZiL4VZCMCxkrM" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}

## Overwrite Protection Results

{% stepper %}
{% step %}

### View Results

1. Click the **Activities** tab.
2. Check that the **Overwrite Protection** job status is **Completed**.
3. Click the **Overwrite Protection** job.&#x20;

   <div align="left"><figure><img src="/files/NOuprRtmmVWG3lr6fi8b" alt="" width="563"><figcaption></figcaption></figure></div>
4. The **Overwrite Protection Results** page lists the status of each component. See the table below for an explanation of each.&#x20;

   <div align="left"><figure><img src="/files/IAVQNy38UxMpqih2sSK2" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
The list of components can be searched and filtered. For example, you could set the **Status** only to display components marked as **Different**.
{% endhint %}

<table><thead><tr><th width="100.333251953125">Status</th><th>Description</th></tr></thead><tbody><tr><td><strong>New</strong></td><td>The component exists in the branch but not in the org. These can usually be committed safely since they don’t exist in the org yet. No action is needed.</td></tr><tr><td><strong>Different</strong></td><td>The component exists in both the branch and org, but their contents differ. Due to this difference, you need to confirm that the changes are accurate and address any conflicts.</td></tr><tr><td><strong>Same</strong></td><td>The component exists in both the branch and org, and the contents are identical. No action is needed.</td></tr></tbody></table>
{% endstep %}

{% step %}

### Review Differences

Review each component marked as **Different** to identify the differences and determine how to resolve them.

1. Click **Resolve**.&#x20;

   <div align="left"><figure><img src="/files/X7l2RJKaNMMLhAiJPydm" alt="" width="563"><figcaption></figcaption></figure></div>
2. The component's differences will be displayed in side-by-side editors with the **diffs** highlighted.
   1. **Incoming**: Read-only editor with the selected org's version of the component.
   2. **Current**: Editable editor with the branch's current version of the component.
3. Review each difference.&#x20;

   <div align="left"><figure><img src="/files/g4llnUPfHKCVmM5wwu1o" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Accept Differences

After you review the differences, you can accept any differences from the **Incoming** org by replacing the **Current** branch's values with the org's values. There are two ways to accept differences; see the following sections for examples.

**Accept All**

Accepting all differences from the **Incoming** org means that all changes in the **Current** branch will be replaced with the values in the org. See the following example:

1. Click **Accept all**.&#x20;

   <div align="left"><figure><img src="/files/KGs1vU9vmmcgPo2gaCrG" alt="" width="563"><figcaption></figcaption></figure></div>
2. All differences in **Current** are replaced with the **Incoming** values.&#x20;

   <div align="left"><figure><img src="/files/glEFX3kW2DI2NneiGUW4" alt="" width="563"><figcaption></figcaption></figure></div>

**Line-By-Line**

Accepting specific differences from the **Incoming** org means that only the selected changes in the **Current** branch will be replaced with the values in the org. See the following example:

1. Click the **Right Arrow** for the line you want to replace the difference in **Current** with the **Incoming** value.&#x20;

   <div align="left"><figure><img src="/files/U7dE2iJqNR9DVotg6M92" alt="" width="563"><figcaption></figcaption></figure></div>
2. The **Current** value is replaced with the **Incoming** value.&#x20;

   <div align="left"><figure><img src="/files/vddCdwm6dh5u0s7SPppH" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}

#### Undo Changes

* **Reset all changes**: lets you undo all changes made in the **Current** editor.&#x20;
* **Ctrl** + **Z**: lets you undo the last change made in the **Current** editor (the editor must be selected).
  {% endhint %}
  {% endstep %}

{% step %}

### Mark Resolved

Once you have edited the **Current** branch to resolve any conflicts caused by the differences, you can mark the component as resolved.

1. Click **Resolve**.&#x20;

   <div align="left"><figure><img src="/files/XwWTwDzuw7UvSVH8cs9h" alt="" width="563"><figcaption></figcaption></figure></div>
2. The component is now marked as **Resolved**.
3. Click **Back**.&#x20;

   <div align="left"><figure><img src="/files/DkwArL6qWDziskdZpUdm" alt="" width="563"><figcaption></figcaption></figure></div>
4. The resolved component will have a **Green Checkmark** to indicate it is resolved.&#x20;

   <div align="left"><figure><img src="/files/98tWyK30hqA8PGdqTWw7" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### (Optional) View Log

You can view the logs for the **Overwrite Protection** job to view any error messages and get job statistics.

1. From the **Overwrite Protection Results** page.
2. Click **See logs**.&#x20;

   <div align="left"><figure><img src="/files/iISFWNwZBqMeSIvhXpSS" alt="" width="563"><figcaption></figcaption></figure></div>
3. View the job statistics and execution log.&#x20;

   <div align="left"><figure><img src="/files/3Nc5MlQJDFEgnJq8mlXY" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
The **Connection** field indicates which org was checked with this **Overwrite Protection** job.
{% endhint %}
{% endstep %}

{% step %}

### Commit Changes

If any components have been changed while resolving differences, you need to commit those changes to the branch.

1. Click **Commit changes**.&#x20;

   <div align="left"><figure><img src="/files/hzRDuBb8ECpaIaovTwDL" alt="" width="563"><figcaption></figcaption></figure></div>
2. Enter a **Commit message** to explain what changed.
3. Click **Resolve** to commit the changes to the branch.&#x20;

   <div align="left"><figure><img src="/files/JziC2jOMwRE2BqZeVtNn" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flosum.com/devops/code/branch-actions/using-branch-overwrite-protection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
