# How to Resolve a Cherry-Pick Failure

Cherry-picking is a common workflow in version control that allows you to selectively integrate specific changes (commits) from one branch into another. However, sometimes a cherry-pick can fail due to a merge conflict. This document will guide you through managing such a scenario during a release process in Aviator.

Setup a repository, connect it to Aviator and [create a release project](/releases-beta/how-to-guides/creating-a-release-project.md) for this guide.

## Create a Base Release

1. Add a new file to your repository. For example, `echo "base" > test.txt`
2. Commit and push the changes to a different branch.
3. Create a pull request to the main branch.
4. Merge the PR into the main branch.

![](/files/z0DHsloS4m9SJDkdlgdi)

5. Cut a release: Create a new release based on this PR.

![](/files/8g6W5BhCd8x6m25AkV2f)

## Raise Two more Pull Requests

1. First PR: `Ensure test.txt` contains "base".
2. Modify the file: `echo "modify1" > conflict-test.txt`.
3. Commit and merge the PR.

![](/files/OOyn0jrcLj017BQaC8cL)

4. Second PR: Confirm that conflict-test.txt shows modify1.
5. Modify the file again: `echo "modify2" > conflict-test.txt`.
6. Commit and merge the PR.

![](/files/c4Y8RKJxIIo8kYRSqEGQ)

### Merge Conflict

To create a merge conflict for this tutorial, go to the Aviator Release Dashboard, select the last PR (the one with modify2), and follow these steps:

1. Select the PR: Click on the PR you want to cherry-pick(last PR in this case).
2. Cherry-Pick: Click the "Cherry-Pick" button to integrate the changes into the base release.

![](/files/Hy6jET5lV3a3vLqnISrj)

You will see a red tag indicating "Failed to cherry-pick" due to a merge conflict. If you encounter this issue, follow the steps below to resolve it.

## Resolve Merge Conflicts

1. On this failed cherry-pick commit, you should see the conflict resolution PR link. Open the link and follow the instructions to resolve the conflict.

![](/files/NgggCrBj98ifNZFBrKKJ)

2. Follow the steps provided by the Aviator-app bot to fetch the code in your dev environment and resolve the conflict. Alternatively, you can use GitHub UI to resolve the conflicts. The conflicting files will be flagged with diffs showing the necessary resolutions. You can click on each conflict and choose which changes to keep or edit the file directly in the GitHub UI. Ensure you select the changes from the second PR as the final result.

![](/files/pguhpj2F0OyIM1ww809E)

3. After pushing the changes, you should be able to merge the PR. You may optionally also get this reviewed by a coworker for correctness.

![](/files/fy7pFVJnTQL8CiLOozAI)

4. Once PR is merged successfully, go back to the UI and click "Accept Resolution". This step is crucial for the resolution to be recognized and accepted as a new Release Candidate (RC).
5. After accepting the resolution, the Release Candidate (RC) should now reflect the correct version of the file following the conflict resolution.

![](/files/C0IvYEF2GyKEXHwO154y)


---

# 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.aviator.co/releases-beta/how-to-guides/resolving-a-cherry-pick-failure.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.
