Skip to main content
uses branches to allow multiple users to work separately and simultaneously within the same project. You can use Merge from branch to integrate changes from another branch into a local copy of your current branch. This action combines the changes from two branches and creates a new unified version of the code. Read Git overview for more details of how manages the work of multiple users with Git features. The branch you merge from (the source branch) can be either a remote branch—the shared version in your Git repository—or a local branch—your own copy that you haven’t pushed yet. This means you can merge in work from a branch even before it exists on the remote. For more about the difference between local and remote branches, read Branches.

Merge changes from another branch


Merge two branches

It’s good Git practice to ensure your branch is up-to-date with the latest changes before making any changes to your branch, committing, and merging. To do this, use the Pull remote changes action.When merging, the changes from the branch designated as Merge from are merged into the local copy of your current branch, designated as Merge into. This means you can validate the changes in your local branch before pushing them up to the remote repository.
To merge the work you have done on one branch to a different branch:
  1. Commit the changes you have made on your source branch.
  2. If you want to merge from the Remote copy of the source branch, push your commits to the remote repository first. To merge from your Local copy, you can skip this step.
  3. Switch to the branch you want to merge changes into, i.e. your target branch.
  4. Click the name of your branch on the project bar.
  5. Click Merge from branch in the drop-down menu.
  6. The Merge changes from another branch panel shows the branch you are merging from (the source branch) and the branch you are merging into (your current, local branch).
  7. Select the branch you want to merge from. The drop-down displays every branch in the current project.
  8. For Location, select Remote or Local to choose which copy of that branch to merge from. Select Local to merge in changes that exist only in your workspace.
  9. Enter a Merge commit message. You can leave the default message, or replace it with one that has more detail about your changes, but you can’t leave the field blank.
  10. If there are no merge conflicts detected, click Merge. Otherwise, see Resolving merge conflicts, below.
  11. Once you click Merge, the changes are integrated into your current branch. A merge from a Local source creates the merge commit in your workspace only—push it when you’re ready to share it with your collaborators.

Resolving merge conflicts

A merge conflict occurs when you try to perform a merge of two branches that each contain changes to pipelines of the same name. Since a branch can’t have two pipelines of the same name, when you merge the branches, only one of the pipelines can be kept. If there is a merge conflict when you use the Merge from branch action, the Merge changes from another branch panel will warn you and require you to resolve the conflict before proceeding. To resolve merge conflicts:
  1. In the Merge changes from another branch panel, in the table listing the files that contain conflicts, click Resolve conflicts.
  2. In the Resolve conflicts panel, you can see the difference between the local and remote versions of each conflicted file.
  3. For each file, select either Keep remote to keep the version in the remote branch you are merging from, or Keep local to keep the version in your current branch.
  4. After you have selected a version of each file to keep, click Save & Continue.
  5. Enter a Merge commit message. You can leave the default message, or replace it with one that has more detail about your changes, but you can’t leave the field blank.
  6. Click Merge.