Skip to main content
Practice Problems

How to resolve merge conflicts in Git?

Happen when same lines changed.

bash
# During merge $ git merge feature CONFLICT in file.js # File shows: <<<<<<< HEAD const x = 1; ======= const x = 2; >>>>>>> feature # Fix: choose one or combine const x = 3; # Finish git add file.js git commit

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.

Finished reading?
Practice Problems