Jo Momma
Jo Momma

Reputation: 1307

How to merge 2 different branches into git, without overwriting changes made by the first commit

I have a master branch "Master" and I create 2 different branches off of it called "Branch-A" and "Branch-B" respectively. The branches are for two different features. When I'm done with Branch-A I merge it back into Master. All is well.

Now I finish Branch-B. I want to merge that into Master too but I know Branch-B doesn't contain the feature that I created in Branch-A which is now merged into Master. Will git see Branch-B as if the code has been changed back (as before Branch-A was merged into Master) and overwrite the changes from Branch-A in Master?

I hope I made this clear.

Upvotes: 0

Views: 613

Answers (1)

eftshift0
eftshift0

Reputation: 30212

No it won't. When you merge branch-b it will consider all changes coming from master (and branch-A, cause it's already part of master) and branch-B.

Upvotes: 1

Related Questions