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.
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 git merge, we converge new_feature and master back together in commit F. git merge is the focus of this chapter, as well as some of the graphical tools accessed by git mergetool (you’ll see a few of them). Because producing branches is so easy, the git merge command is an important tool.
When you run the git merge command, you merge branches into whatever branch you have currently checked out, as shown in figure 10.2.