Search code examples
git

Merge conflict marker encountered


SourceTree Merge Conflict

I have created a local "Test" branch in SourceTree for testing some new features and everything seemed to work fine. Then I merged the "master" branch into my local "Test" branch and unfortunately, pushed it. But since then by running "ng serve" I'm getting the following error:


52 <<<<<<< HEAD
app/app.module.ts:54:1 - error TS1185: Merge conflict marker encountered.

54 =======
app/app.module.ts:56:1 - error TS1185: Merge conflict marker encountered.

56 >>>>>>> master
app/example/example.module.ts:9:1 - error TS1185: Merge conflict marker encountered.

9 <<<<<<< HEAD

I have no idea what's going on here. Is there any way to solve this issue easily?


Solution

  • while you're merging master into your local feature branch there are some conflicts, you need to resolve them by accepting the current or incoming changes. Open those files and remove these <<<<<<< HEAD >>>>>>> master and commit your changes. If you've Visual Studio Code will clearly show you the conflicts.

    Files that had conflict marker:

    app/example/example.module.ts:9:1 // in this file line number 9 should've conflict marker **>>>>>**
    app/app.module.ts:54:1 // in this file line number 54 should've conflict marker **>>>>>**
    app/app.module.ts:56:1 // in this file line number 56 should've conflict marker **>>>>>**
    

    Once you resolved the conflicts and still getting the error, the files might have been cached, try to switching to another branch, then switching back to the original.

    Still Webpack isn't noticing your file changes - https://dev.to/pnevares/webpack-isn-t-noticing-your-file-changes-did-you-do-something-wrong-34dc