0

Imagine a project that has a master branch called "master".

About 3 months ago, a developer branched off of master, making a new branch called "dev".

Now, 300 commits on "dev" later, with significant changes to the codebase and some removed and added files, I've been tasked with merging dev back into master. The problem that I'm running into is the volume of changes is way too much to do manual merge on. Ideally, what I'd like to do is something like git merge -s theirs dev from master, where it does the merge automatically taking all the diff from dev.

Is there a way of doing this?

Chris
  • 1,783
  • 3
  • 18
  • 26
  • Duplicate of [git merge -s ours, what about "theirs"](http://stackoverflow.com/questions/173919/git-merge-s-ours-what-about-theirs) –  Apr 12 '14 at 02:33

1 Answers1

2

This is explained in the documentation for git merge, as well as in numerous other sources:

git checkout master
git merge -s recursive -X theirs dev

The documentation:

The recursive strategy can take the following options:

ours

This option forces conflicting hunks to be auto-resolved cleanly by favoring our version. Changes from the other tree that do not conflict with our side are reflected to the merge result. For a binary file, the entire contents are taken from our side.

theirs

This is the opposite of ours.