Merging Changes Together
The previous chapter, Advanced Branching Techniques, described how to use branches effectively for collaboration and development.
This chapter will teach you how to integrate changes from different parallel lines of development together (that is, branches) by creating a merge commit, or by reapplying changes with the rebase operation. Here, the concepts of merge and rebase are explained, including the differences between them and how they can be used. This chapter will also explain the different types of merge conflicts and teach you how to avoid them, examine them, and resolve them.
In this chapter, we will cover the following topics:
- Merging, merge strategies, and merge drivers
- Cherry-picking and reverting a commit
- Applying a patch and a patch series
- Rebasing a branch and replaying its commits
- A merge algorithm at file and contents level
- Three stages in the index
- Merge conflicts – how to examine and resolve them...