Bitbucket - Fix merge conflicts

11,285

It means that both the branch you are merging onto and the branch you are merging in have changes affecting those lines. git can't tell which version of those lines is the one you want to keep, so it stops the merge and lets you solve the conflict yourself. It does this by keeping both versions of the affected lines, separated by ======. The <<<<< and >>>>> lines indicate where the conflict begins and where it ends.

You solve the conflict by manually editing the affected file. In your case, it looks like it's just a whitespace change, so you can delete one of the two repeated

}
else {
    var filter = -1;
}

sections, as well as the +<<<<<<< destination:b9a9e6b6e3b21d06f9f726ba8a3b24c221c695f4, +=======, and +>>>>>>> source:8ab52e4f8401ac8b5b68682d888e7538a7183216 lines.

For more information on merging it git, read this.

Share:
11,285
Bernhard Pointner
Author by

Bernhard Pointner

Updated on June 15, 2022

Comments

  • Bernhard Pointner
    Bernhard Pointner almost 2 years

    I know that there are some questions with this topic but out of them I didn't get a answer for my problem.

    I am working with Bitbucket and I am not sure if I am always doing all corretly because I am very new at Bitbucket

    I have a conflict at merging a branch into master.

        // Check if a filter is set
        if(filter_id) {
            var filter = filter_id;
    +<<<<<<< destination:b9a9e6b6e3b21d06f9f726ba8a3b24c221c695f4
        }
        else {
            var filter = -1;
        }
    +=======
    +   }
    +   else {
    +       var filter = -1;
    +   }
    +>>>>>>> source:8ab52e4f8401ac8b5b68682d888e7538a7183216
    

    Do you have any idea how I can fix this error? Maybe by modifying the code?

    What does this conflict mean in general? What have I done wrong?

    Thank you for your answers!