---
schema_version: "1"
id: 265885cb8bc7e43735a2b8c3e8d8572ca9c18d17425f319a3890d4a511baa696
title: Solve Git Conflicts in API Projects
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/studio/solving-conflicts-api-projects.md
canonical_url: https://docs.mulesoft.com/studio/solving-conflicts-api-projects
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 046aad1ff03ee3d10a03da286480b25e509bffb4e655a265d157e7e249ea4831
description: MuleSoft Documentation Site
latest: true
---
---
product: Studio
---

# Solve Git Conflicts in API Projects

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Resolve a Git conflict in your API project when someone else changes a version in MuleSoft VCS while
you modify the same version locally.

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 MuleSoft VCS. 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 MuleSoft VCS,
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](/mulesoft/current/en-us/studio/_images/push-branch.png)

2.  Git rejects the push due to the conflicting file:

    ![A window appears with the push results, including the repository URL and message details](/mulesoft/current/en-us/studio/_images/conflict.png)

3.  Pull the changes from MuleSoft VCS into your local version.

    ![A menu displaying choices for a Git repository](/mulesoft/current/en-us/studio/_images/pull-changes.png)

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](/mulesoft/current/en-us/studio/_images/flagged-commit.png)

<table><tbody><tr><td><i data-value="1"></i><b>1</b></td><td>Your local commit flagged as conflicting.</td></tr><tr><td><i data-value="2"></i><b>2</b></td><td>The commit made by another collaborator flagged as conflicting.</td></tr></tbody></table>

5.  Git flags the conflicting parts of the file in the API editor view:

    ![Code displaying a RAML API for American Flights](/mulesoft/current/en-us/studio/_images/resolve-marked-conflict.png)

    ```linenums
    <<<<<<< HEAD
              - LAX
              - CLE
    ======= (1)
              - CLE
              - LAX
    >>>>>>> branch 'add-flights-path' of https://anypoint.mulesoft.com/ (2)
    ```

    <table><tbody><tr><td><i data-value="1"></i><b>1</b></td><td>Everything between the characters <code>HEAD</code> and <code>=======</code> are your changes.</td></tr><tr><td><i data-value="2"></i><b>2</b></td><td>Everything between the characters <code>=======</code> and <code>branch …​</code> are the changes in MuleSoft VCS conflicting with yours.<div><p>In this case, another collaborator changed the definition from:</p></div><div><div><pre><code data-lang="raml">/flights:
      get:
        queryParameters:
          destination:
            required: false
            enum:
              - SFO
              - LAX
              - CLE</code></pre></div></div><div><p>To:</p></div><div><div><pre><code data-lang="raml">/flights:
      get:
        queryParameters:
          destination:
            required: false
            enum:
              - SFO
              - CLE
              - LAX</code></pre></div></div><div><p>The conflict happens because git does not know which change to prioritize.</p></div></td></tr></tbody></table>

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

    ![A code editor displaying a commit message and a conflict list](/mulesoft/current/en-us/studio/_images/push-conflict-changes.png)

<table><tbody><tr><td><i data-value="1"></i><b>1</b></td><td>Ensure that your changes remain in the file.</td></tr><tr><td><i data-value="2"></i><b>2</b></td><td>Add your changes to the index.</td></tr></tbody></table>

7.  Select **Commit and Push**.

Your copies between Studio and MuleSoft VCS are synchronized with your latest changes.

## See Also

- [Edit API Specifications Offline and Sync Them with MuleSoft VCS](https://docs.mulesoft.com/studio/sync-api-projects-design-center)
