Chapter 10. Merging branches

In the preceding chapter, you created multiple branches, diverging your code base. You learned that when you work on a branch, you’re working on a separate line of development. If you want to incorporate the work from your separate branch back into your main line of development, you need to use git merge, as shown in figure 10.1.

Figure 10.1. A typical merge. The commits are the boxes with letters.

Branching diverges code bases, and merging converges code bases. In figure 10.1, we diverge the code base at commit B, making two branches: master and new_feature. We then make some commits on both branches. Next, using ...

Get Learn Git in a Month of Lunches now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.