# Resolving conflicts

When a user needs to commit changes made to a file, but that same file has received other modifications (likely from other users) in the meantime, it is necessary to first "merge" the two sets of modifications together.

When the two sets of modifications do not overlap, merging is trivial - at least conceptually. But when they do overlap, they produce conflict(s).

Since Teams focuses on collaboration over IDA database files, the rest of this section will focus on the different strategies that are available for resolving conflicts among those.

The Teams comes with multiple strategies to help in conflict resolution of IDA database files:

* [Auto-resolve (if no conflicts)](#auto-resolve-if-no-conflicts)
* [Auto-resolve, prefer local](#auto-resolve-prefer-local)
* [Auto-resolve, prefer remote](#auto-resolve-prefer-remote)
* [Interactive merge mode](#interactive-merge-mode)
* [Use local, discard remote](#use-local-discard-remote)
* [Use remote, discard local](#use-remote-discard-local)

## Auto-resolve (if no conflicts)

1. Launch IDA in a non-interactive batch mode, attempting to perform all merging automatically.
2. If any conflict is discovered, bail out of the merge process, and don’t modify the local database.

## Auto-resolve, prefer local

1. Launch IDA in a non-interactive batch mode, attempting to perform all merging automatically.
2. If a conflict is discovered, assume that the "local" change (i.e., the current user’s change) is the correct one, and apply that.
3. Once all merging is done and conflicts are resolved, write those to the local database and exit IDA.

## Auto-resolve, prefer remote

1. Launch IDA in a non-interactive batch mode, attempting to perform all merging automatically.
2. If a conflict is discovered, assume that the "remote" change (i.e., the change made by another user) is the correct one, and apply that.
3. Once all merging is done and conflicts are resolved, write those to the local database and exit IDA.

## Interactive merge mode

This is a manual merge mode.

1. Launch IDA in an interactive, 3-pane mode, allowing the user to decide how to resolve each conflict.
2. Once all merging is done and conflicts are resolved, exit IDA and write the changes to the local database.

## Use local, discard remote

1. Select the local database, ignoring all changes in the remote database.

No IDA process is run.

## Use remote, discard local

1. Select the remote database, ignoring all changes in the local database.

No IDA process is run.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hex-rays.com/extensions/teams/how-tos/resolving-conflicts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
