Merge from branch
Designer uses branches to allow multiple users to work separately and simultaneously within the same project.
After committing and pushing your changes to the remote branch, you can use Merge from branch to integrate changes from that remote branch to a local copy of another 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 Designer manages the work of multiple users with Git features.
Merge changes from another branch
Property | Description |
---|---|
Merge from (Remote branch) | A drop-down list that displays all branches in your project. This is the remote branch you want to merge your changes from, also known as the source branch. The latest commit on the selected source branch is also displayed. |
Merge into (Local branch) | This is your current branch, also known as the target branch where you want the changes from a remote branch to be merged into. You can't edit this field. |
Merge commit message | A text field that is autopopulated by a default merge commit message, which is editable. |
Merge two branches
Note
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, note that the changes from the remote branch designated as Merge from, are being 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 it up to the remote repository.
To merge the work you have done on one branch to a different branch:
- Commit the changes you have made while you are on your current branch.
- Push your local commit to the remote repository.
- Switch to the branch you want to merge changes into, i.e. your target branch.
- Click Merge from branch from the branch menu on the project bar.
- The Merge changes from another branch panel shows the branch you are merging from (the remote branch) and the branch you are merging into (the local branch).
- Select the remote branch you want to merge from. The Remote branch to merge from drop-down will display every branch in the current project.
- 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.
- If there are no merge conflicts detected, click Merge. Otherwise, see Resolving merge conflicts, below.
- Once you click Merge, you should see the remote changes integrated into your current branch.
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. The Merge changes from another branch panel will warn you when there is a merge conflict, and require you to resolve the conflict before proceeding.
To view and resolve merge conflicts:
- Commit the changes you have made while you are on your current branch.
- Push your local commit to the remote repository.
- Switch to the branch you want to merge changes into, i.e. your target branch.
- Click Merge from branch from the branch menu on the project bar.
- If there are merge conflicts detected, the Merge changes from another branch panel displays a warning and a table listing the files that contain conflicts.
- Click the Compare changes icon next to any listed pipeline to open the Compare conflicting files panel and view the difference between the local and remote versions of this pipeline.
- In the Merge changes from another branch panel, in the Version column of the table, select either Remote to keep the version in the remote branch you are merging from, or Local to keep the version in your current branch.
- After you have selected a version of each pipeline to keep, enter a merge commit message and click Merge.