What tools does Git give you to resolve a merge conflict, such as choosing ours/theirs or using a mergetool?

Last updated 6 July 2026

  • Edit the conflict markers (<<<<<<<, =======, >>>>>>>) by hand, then git add the file. Or take a whole side with git checkout --ours/--theirs <file> (in a merge, "ours" is the current branch).

  • git mergetool opens a configured 3-way GUI (e.g. meld, vimdiff) showing base, ours and theirs.

  • merge.conflictStyle=diff3 adds the base version to markers for context. git merge --abort backs out to start over.

  • https://dev.to/devopsdaily/how-to-resolve-merge-conflicts-in-git-without-guessing-markers-ours-theirs-and-the-rebase-flip-b4g
  • https://git-scm.com/book/uz/v2/Git-Tools-Advanced-Merging
  • https://github.com/kugelpunk/progit2-windows-related/blob/main/book/07-git-tools/sections/advanced-merging.asc
  • https://community.atlassian.com/forums/discussion/2476971/advanced-git-merge-conflict-resolution-techniques
  • https://man7.org/linux/man-pages/man1/git-mergetool.1.html
  • https://www.kernel.org/pub/software/scm/git/docs/git-mergetool.html
  • https://docs.github.com/en/pull-requests/how-tos/merge-and-close-pull-requests/resolving-a-merge-conflict-using-the-command-line
All Git interview questions