How do you manage merge conflicts in Git?

Managing a Git merge conflict means locating the files Git couldn't automatically reconcile, manually choosing or combining the correct content, and then marking those files as resolved before continuing the operation.

Key Points

Example

After git merge feature-branch reports a conflict in PaymentService.java, the developer opens the file, sees the conflict markers, keeps the correct logic from both sides, removes the markers, then runs git add PaymentService.java and git commit to finish the merge.

<<<<<<< HEAD
int timeout = 30;
=======
int timeout = 60;
>>>>>>> feature-branch

Interview Tip

A concise interview answer is

I find the conflicting files with git status, edit them to resolve the sections marked with the conflict markers, then stage them with git add. Once every conflict is resolved, I finish the merge or rebase with commit or rebase --continue.

Last updated: 16 July 2026

Previous question: How does the git rebase command work, and when should you use it instead of merging?

Next question: Explain the rebase process and its advantages over merging.

More Git - Level II interview questions

All Git - Level II questions