In certain scenarios, someone else might have modified the version in Design Center while you modified the same version locally. This triggers a conflict in git.
For example, you might have modified a file in a branch, while someone else modified this very same file in the same branch directly in Design Center. By the time you want to push your changes, git rejects the push command because it cannot fast-forward your changes to the version in Design Center, meaning that you must tell git how to apply your changes over a modified version:
In the Package Explorer view, right-click your API project and select Team > Switch To > Push Branch….
Git rejects the push due to the conflicting file:
Pull the changes from Design Center into your local version.
Evaluate the conflicts flagged by git:
1 Your local commit flagged as conflicting. 2 The commit made by another collaborator flagged as conflicting.
Git flags the conflicting parts of the file in the API editor view:
<<<<<<< HEAD - LAX - CLE ======= (1) - CLE - LAX >>>>>>> branch 'add-flights-path' of https://anypoint.mulesoft.com/ (2)
1 Everything between the characters
=======are your changes.
2 Everything between the characters
branch …are the changes in Design Center conflicting with yours.
In this case, another collaborator changed the definition from:
/flights: get: queryParameters: destination: required: false enum: - SFO - LAX - CLE
/flights: get: queryParameters: destination: required: false enum: - SFO - CLE - LAX
The conflict happens because git does not know which change to prioritize.
Remove the change you don’t want to keep:
1 Ensure that your changes remain in the file. 2 Add your changes to the index.
Select Commit and Push.
Your copies between Studio and Design Center are synchronized with your latest changes.