Main Content

Merge Requirement Set and Link Set Files

This example explains how to merge changes from multiple requirement set and link set files.

Merge Files with No Conflicts

If you are editing a requirements file which is also concurrently modified by another user, you can get the changes from the other user using Git™ merge. If you want to merge the files, you first have to make sure you have Git and run the comparisons.ExternalSCMLink.setupGitConfig command.

To merge a file without any conflict:

1. At the MATLAB® command prompt, enter:

slreqCCMergeSetup

This helps you to set up two branches, User1Feature and User2Feature, where User2Feature is the current active branch.

2. To inspect the changes in each branch, switch to that branch and right-click the file in the current folder browser and select Compare To Ancestor.

3. To merge changes from User1Feature branch to User2Feature branch, set User2Feature branch as the current branch and select User1Feature branch in Branch browser. Then click Merge to execute the merge operation.

4. To confirm if the changes are merged successfully into User2Feature branch, select the file in current folder browser and click Compare to Ancestor.

Merge Files with Conflicts

If the merged file has conflicts, you can view the file and resolve the conflicts manually. To resolve a merge conflict:

1.At the MATLAB® command prompt, enter:

slreqCCMergeConflictSetup

This helps you to set up two branches, User1Feature and User2Feature, where User2Feature is the current active branch.

2. To inspect the changes in each branch, switch to that branch and right-click the file in the current folder browser and select Compare To Ancestor.

3. Select the User1Feature branch and click Merge to execute merge command. Observe that MATLAB reports a conflict.

4. The Merge tool automatically merges non-conflicting changes. To view the conflicting changes, right-click the file in current folder browser and click View Conflicts.

5. To manually resolve conflicts, open the requirement set in Requirements Editor and make the changes.

6. Right-click the file and select Mark Conflicts Resolved.

7. Click Commit to merge the changes.

8. Right-click the file and select Compare to Ancestor to observe the merged changes.

See Also