Your First Conflict

You’re here to learn about conflicts! So let’s get conflicted.

walkthrough of a merge conflict

  1. Check out to the master branch.
  2. In _config.yml, change lines 2-3 again to update your resume’s title, and description. Ensure your changes are different from those in step 2 from the previous page of instructions.
  3. Return to your Pull Request. A conflict now appears because my-title is based on a previous point in history, and new commits override our proposed change. Let’s solve this, our first conflict. Click on Resolve conflict.
  4. Remove the conflict markers and choose your desired title.

    To dive into all of the odd symbols on your screen, check out the Tell me why section.

  5. Click Mark as resolved.
  6. Click Commit merge.
  7. Your Pull Request is now free of conflicts. Click Merge pull request to merge your pull request!
Tell me why

Examing Merge Conflicts

Looking at an example merge conflict from our help documentation, we can discuss the different pieces that encompass a merge conflict.

If you have questions, please
<<<<<<< HEAD
open an issue
ask your question in IRC.
>>>>>>> branch-a

The <, =, and > symbols simply identify where the merge conflict occurred. We can see that both HEAD and branch-a are listed in the merge conflict. HEAD is pointing to the branch that you are currently checked out to, so it might say the branch you currently are on or HEAD. The other branch listed, in this example, branch-a identifies that changes exist on another branch that conflict with the changes we made.

Stuck? Open an issue in the repository for this class and mention @githubteacher for help from one of the GitHub trainers!