Resolving merge conflicts
Merging in Git is typically fairly easy. Since Git stores and has access to a full graph of revisions, it can automatically find where the branches diverged and merge only those divergent parts. This works even in the case of repeated merges, so you can keep a very long-lived branch up to date by repeatedly merging into it or rebasing it on top of new changes.
However, it is not always possible to automatically combine changes. There are problems that Git cannot solve because, for example, there were different changes to the same area of a file on different branches. These problems are called merge conflicts. Similarly, there can be problems while reapplying changes, although you would still get merge conflicts in case of problems.
The three-way merge
Unlike some other version control systems, Git does not try to be overly clever about merge conflict resolutions and try to solve them all automatically. Git’s philosophy is to be smart about...