Daniel Arbuckle's Mastering Python
上QQ阅读APP看书,第一时间看更新

Merging codes

To merge code from a different branch, all we have to do is to use the git merge command from inside the branch we're merging to and give it the name of the branch we're merging from. If the two branches cannot be automatically combined, Git will do it for us:

That's usually all there is to it, but sometimes there are overlapping changes in both branches; when that happens, Git knows it's not smart enough to handle the merger on its own.

When we run git merge, it will notify us that there are conflicts. Then, we can use git mergetool to start up the merge resolution tool: