Introduction

Completed

GitHub's distributed version-control approach enables incredible scale for software projects. By following the branch-and-merge paradigm, it's easy to scale the number of developers working in parallel on a project.

Suppose you're a developer on a growing project. Your team aggressively expands functionality and fixes bugs every day. However, sometimes two developers make changes to the same lines of code. One developer might be fixing a bug, while another is adding a feature. Neither developer made a mistake here, but you can't have both versions of those lines in the codebase at the same time. How do you decide whose lines to keep? Or maybe you need to use a third option that preserves the changes applied by both developers, but in a slightly different form.

In this module, you learn how to settle overlapping commits across branches by using merge-conflict resolution.

Learning objectives

In this module, you'll:

  • Understand how merging happens and what causes merge conflicts.
  • Resolve simple and complex merge conflicts with ease.
  • Share best practices to reduce merge conflicts with your team.

Prerequisites

  • A GitHub account
  • The ability to navigate and edit files in GitHub
  • Familiarity with pull requests

We recommend that you complete Manage repository changes by using pull requests on GitHub before beginning this module.