How does branch merging really work (under the hood)?

This may be a naive question, but as asked in the object, what is the actual path used by version control software to merge the branch back into the main trunk without generating broken code?

Here's a quick example: I'm making a branch from the main trunk for the Hello World Power edition program. I am adding Klingon support. This is a radical change that changes the way printHelloWorld () functions.

Meanwhile, due to bug # 749, which causes "Hello World" to be written "Helo World", the printHelloWorld () function in the main trunk has been changed.

Now the problem that I see here is this: when I merge down the branch back to the main trunk, I experiment with the collision of the printHelloWorld () function in the sayHello.py file

How does the VCS program know how to add Klingon support from my branch and save the bug fix in the main line? What are human or software driven strategies to avoid this?

Thanks in advance.

+5
source share
3 answers

How does the VCS program know how to add Klingon support from my branch and save the bug fix in the main trunk?

VCS , / . VCS diff/merge . , . VCS, SVN, , , , , .

, , , , . - .

+3

, . .

0

, , . . , .

A good strategy for working in a branch is to transfer changes to the trunk in your branch on a regular basis. This ensures that you do not drift too apart from the trunk, which will cause problems when you eventually connect to the trunk.

0
source

All Articles