0

Here is my situation,

I have to create a new branch C like this:- first branching off from A and then merging in B

The steps i followed:

New branch C is created branching off from A B is merged into C

Now, the diff show no conflict however, which file's content will be resolved automatically whether is it the B's contents or C's content that will take precedence in a no conflict situation.?

Does the source branch's file contents take precedence or the destination branch's file contents will take precedence for auto merge.

blogs4t
  • 2,329
  • 5
  • 20
  • 33
  • https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging#_basic_merging – phd Mar 04 '19 at 20:50
  • https://stackoverflow.com/questions/14961255/how-does-git-merge-work-in-details – phd Mar 04 '19 at 20:50
  • I *think* you're trying to ask the same question as https://stackoverflow.com/q/42099431/1256452 – torek Mar 04 '19 at 22:04

1 Answers1

1

By default, there is no "precedence". Git will try to merge the differences fro both branches together. There's a merge strategy available where you can tell git "forget about the changes on the other branch and take mine", but by default with recursive, the changes of both branches are considered and... well, merged together.

eftshift0
  • 26,375
  • 3
  • 36
  • 60