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 commitShort Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.