Information Technology Reference
In-Depth Information
You and your colleague are working on the same project. You both appreciate the inde-
pendence offered by the git branching model. Therefore each of you has created a
branch. Unfortunately, while working in different branches, you both edited the same
file inserting overlapping changes. Now you want to merge your work with the work of
your colleague. During this operation you will face the conflict. You want to resolve
the conflict in such a way that everything you and your colleague typed in the file is
preserved.
This real-life scenario simplifies to merging the branches
en
and
fr
in the reposit-
ory we created in Recipe 9-1. You want to use a repository created in Recipe 9-1 as a
starting point. The result you want to achieve is shown in
Figure 9-2
.
The second line
keep both conflicting words
two
and
deux
.
Figure 9-2
.
The repository from Recipe 9-1 with merged branches en and fr
Listing 9-4.
The numbers.txt file after merging the en and fr branches