Skip to main content

Merging Sprint Branches

In this section, you will learn how to merge the sprint branch to the main branch.

Once endpoint definitions are developed and deployed within a sprint branch, you have the option to merge some or all of the endpoint changes from the sprint branch into the main branch.

Merging Sprint Branches

When you are in a sprint branch, you can see the "Merge" button in the branch switch next to APIs. You can also see the Merge to main button at the right bottom of the APIs.

Apidog Merging Sprint Branches Entry Point

In automated testing, individual test scenarios require separate merging and do not merge automatically with resources in APIs. While in a sprint branch, you can find the 'Merge to Main' dropdown option by hovering over the ... button next to a test scenario in automated testing.

Apidog Merging Test Scenario Entry Point

Overview of Pending Merges

In APIs, clicking the "Merge" button opens the merge overview popup.

Apidog Merge Overview

In this popup, you will see key elements:

  • Filter: Use the filter to view only the resources in the current sprint branch that have been modified compared to the main branch, or view all resources in the current sprint branch. By default, modified resources are shown to help users focus on changes.
  • Merging Preview: This section displays the final effect on the main branch directory after merging the current sprint branch. Use this directory to confirm the placement and content of resources post-merge. Resources in the directory are marked with color-coded dots (gray for unchanged, orange for modified, green for new) to indicate their status. Use the checkboxes on the right to select or deselect resources for merging into the main branch.
  • Post-Merge Endpoint Status: Choose how to adjust the status of the merged resources in the main branch. Options include Follow the Current Branch, Follow Main, or Specified Status.

Detailed Review of Pending Merges

In the merge overview popup, you can perform additional operations on the folder content to review whether the resources should be merged into the main branch. Clicking a resource expands the popup to show detailed content, aiding in the merge decision.

Different resources have different merge logic and details:

  • New Resources:

    • New Resources refers to resources created in the current sprint branch, not present in the main branch.
    • If merged, the resource will be created in the main branch at the specified location.
    • Click to view the complete content of this resource, as shown in the image below.

    Apidog New Resource Details

  • Modified Resources:

    • Modified Resources refers to resources that is forked from the main branch into the current sprint branch and associated with the main branch resource.
    • If merged, the main branch resource will be overwritten.
    • Click to see the changes of this resource compared with the main branch resource, as well as the complete content, as shown in the image below.

    Apidog Modified Resource Details

  • Unchanged Resources:

    • Unchanged Resources refers to resources that is forked from the main branch without any modifications in the current sprint branch.
    • Unchanged resources cannot be selected for merging (and don't need to be).
    • Clicking shows no detailed content for this resource, as shown in the image below.

    Apidog Unchanged Resource Details

Clicking the merge button at the bottom right will merge all selected resources from the folder into the main branch according to the sprint branch settings. Note that if a parent resource is not selected, none of its child resources can be merged individually.

Apidog Merge Confirmation Popup

After merging, a toast message confirms the operation's success, closes the merge popup, and opens a summary popup to review the changes made to the main branch.

Apidog Merge Completion Popup

Viewing Merge Details / Reverting Merges in the Main Branch

In the main branch, accessing the Change History of a resource displays the content modified through merges, allowing users to view detailed modification. Additionally, users can compare the content with that of other versions, facilitating easy tracking and rollback of changes.

Apidog Main Branch Resource History

Apidog Main Branch Resource History

Merging Automated Test Scenarios

Automated test scenarios and endpoints are merged independently. Test scenarios need to be merged individually, without an overall merge page.


Please merge the resources in APIs first before merging test scenarios. Failing to do so may cause related test scenarios in the main branch to run abnormally after merging.

When you are in a sprint branch, hover your mouse over the ... button of a test scenario in automated testing to see the "Merge to Main" option.

Apidog Merging Test Scenario Entry Point

Clicking this opens the test scenario merge popup, displaying the following information:

  • Basic Information: Shows the sprint branch test scenario to be merged and the associated main branch test scenario (if any).
  • Last Run Result: Displays the last manual run result of the test scenario in the sprint branch. Hovering over the icon shows a summary of the results. Testers can use this information to decide whether to proceed with the merge. If the result shows Untested or Failed, it is recommended to ensure the test scenario passes the test completely before merging.
  • Merge Action: Options include Overwrite and Add. If the test scenario was forked from the main branch, it will be merged by overwriting the main branch resource; if the test scenario is new, it will be added to the main branch.

Apidog Test Scenario Merge Popup