In what scenarios does merging commits from A to B also bring changes from B to A?

Viewed 29

Suppose, I have two branches C and A, where A was made with C as base.

Given some time, C and A will be having different commits based on the features implemented and bugs fixed in both.

Now, suppose I just needed the commits of C in A. For this I did:

  • Made a new branch B with C as the base branch.
  • Created a pull request with A as base and compared it with B.
  • Now I see commits and changes from C which were not there in A and so I happily merged the PR after some approvals.

After the PR is merged, I see A has all the changes of C but wait, C has all the changes of A as well. I just wanted to know in what all scenarios can this happen and well, how I can avoid it?

If this was not the right way to bring changes from C to A, please let me know the right way of doing it.

0 Answers
Related