0

I created TestA and TestB branches from the TestUAT branch then made the following changes:

  1. Changed some code in Class A on TestA
  2. Commited the changes , created a pull request to merge branch TestA with TestUAT. It gave no conflicts.
  3. Changed some other line of codes in the same class A on TestB. Committed these changes, created pull request to merge branch TestB to TestUAT. Here, it got auto-merged without any conflict errors.

My questions are:

  1. In which condition will it show merge conflict?

I thought it should show a conflict if the source branch and destination branch both differ from their last code base. In the above example, when I perform step 3, the TestUAT branch is changed from its previous code base (as i have merged TestA with TestUAT) and TestB has also changed (code changes done in Class A). I should have got the merge conflict error for this scenario.

  1. How to stop the auto-merge which is happening in this case?
Marc L.
  • 3,296
  • 1
  • 32
  • 42

1 Answers1

0

The merging algorithm is much smarter than that and there are also different strategies you can use. You can look here for more information https://git-scm.com/docs/merge-strategies

For the auto-merging issue see this thread How do I prevent an automerge using Git?

Sgiath
  • 360
  • 2
  • 8