Contact Us 1-800-596-4880

Solve Conflicts

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:

  1. In the Package Explorer view, right-click your API specification project and select Team > Switch To > Push Branch…​.

    A dropdown menu displaying choices for a software development project, featuring Git commands such as pull and push
  2. Git rejects the push due to the conflicting file:

    A window will appear with the push results, including the repository URL and message details
  3. Pull the changes from Design Center into your local version.

    A menu displaying choices for a git repository
  4. Evaluate the conflicts flagged by git:

    A window displaying the outcomes of a fetch and update of flights-api data, with a conflicting result and two merge input choices
1 Your local commit flagged as conflicting.
2 The commit made by another collaborator flagged as conflicting.
  1. Git flags the conflicting parts of the file in the API editor view:

    Code displaying a RAML API for American Flights
    <<<<<<< HEAD
              - LAX
              - CLE
    ======= (1)
              - CLE
              - LAX
    >>>>>>> branch 'add-flights-path' of https://anypoint.mulesoft.com/ (2)
    1 Everything between the characters HEAD and ======= are your changes.
    2 Everything between the characters ======= and 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

    To:

    /flights:
      get:
        queryParameters:
          destination:
            required: false
            enum:
              - SFO
              - CLE
              - LAX

    The conflict happens because git does not know which change to prioritize.

  2. Remove the change you don’t want to keep:

    A code editor displaying a commit message and a conflict list
1 Ensure that your changes remain in the file.
2 Add your changes to the index.
  1. Select Commit and Push.

Your copies between Studio and Design Center are synchronized with your latest changes.