What are the different merge strategies in Git (ort/recursive, ours, octopus), and when does each apply?

Last updated 6 July 2026

  • ort (default, a faster rewrite of recursive) three-way merges two heads. If there are multiple common ancestors, it first merges them into one virtual base.

  • ours records a merge but keeps the current branch's tree entirely, marking a branch as merged without taking its changes. octopus merges three or more branches at once and refuses if any conflict arises.

  • -X ours/theirs is a strategy option, not a strategy: it auto-resolves only conflicting hunks toward one side while merging the rest.

  • https://git-scm.com/docs/merge-strategies
  • https://www.atlassian.com/git/tutorials/using-branches/merge-strategy
  • https://mattrickard.com/git-merge-strategies-and-algorithms
  • https://lithiumgit.com/blogs/stop-guessing-choose-the-right-git-merge-strategy-every-time
  • https://www.geeksforgeeks.org/git/merge-strategies-in-git/
  • https://blog.devops.dev/how-to-merge-multiple-branches-at-once-with-git-octopus-merging-ec3e58bd486e
  • https://dev.to/thezal/monstrous-git-merge-strategies-navigating-the-dungeons-of-version-control-37ch
All Git interview questions