user3460047
user3460047

Reputation: 163

Git branch and merge : modifications from 2 branches with no conflict?

I'm puzzled by the git behaviour and i would like to have some explanations. Let me explain, i have 2 branches :


The workflow :


Result : No conflict. my_feature_branch do not retrieve the changes from master in "feature.java". Git considers that "feature.java" from my_feature_branch is all correct.

Consequences : The fix did in master is not reported in my_feature_branch.

Upvotes: 0

Views: 96

Answers (1)

Kishan Rajdev
Kishan Rajdev

Reputation: 1965

in most cases, Git will figure out how to integrate new changes.

However, there's a handful of situations where you might have to step in and tell Git what to do. Most notably, this is when changing the same file. Even in this case, Git will most likely be able to figure it out on its own. But if two people changed the same lines in that same file, or if one person decided to delete it while the other person decided to modify it, Git simply cannot know what is correct. Git will then mark the file as having a conflict - which you'll have to solve before you can continue your work.

Upvotes: 1

Related Questions