davidtcalabrese / merge-conflicts

https://lab.github.com/githubtraining/managing-merge-conflicts
MIT License
0 stars 0 forks source link

Create your own conflict #4

Closed github-learning-lab[bot] closed 3 years ago

github-learning-lab[bot] commented 3 years ago

Step 5: Create your own conflict

So far, this pull request doesn't have any conflicts. I have added some new branch protections to prevent you from merging before you're ready.

In the last activity, you solved a merge conflict that someone else created. This time, you'll create the merge conflict yourself.

:keyboard: Activity: Make changes on this branch

  1. Click on the Files changed tab in this pull request.
  2. Click octicon-kebab-horizontal in the top right-hand corner of the _data/education.yml file that had been previously modified.
  3. Click Edit file to open the file editor.
  4. Modify the content in the degree:, uni:, year:, and summary: lines.
  5. Scroll to the bottom of the page and enter a commit message for your change.
  6. Click the Commit changes button, making sure the "Commit directly to the add-education branch" option is selected.

Watch below for my response.

github-learning-lab[bot] commented 3 years ago

Where do conflicts come from?

In a real world scenario, it's possible that a peer or colleague will have edited the same file in the same place as your pull request.

To demonstrate, I'll stand in as your colleague :wave:. In this other pull request https://github.com/davidtcalabrese/merge-conflicts/pull/2, you'll see that the education file has been changed. The other pull request was just merged to main, which means there's now a conflict in your pull request.

Step 6: Resolve new conflicts

:keyboard: Activity: Resolve the conflict

  1. In the "This branch has conflicts that must be resolved" section of the pull request, click Resolve conflicts.

Because you created the conflict, feel free to resolve this conflict as you wish.


Return to this pull request for next steps.

github-learning-lab[bot] commented 3 years ago

Step 7: Merge the pull request

Great job, @davidtcalabrese, your pull request is free of conflicts. :tada: Go ahead and merge this pull request now.

:keyboard: Activity: Merge this pull request

  1. Click Merge pull request below.
  2. Click Confirm Merge.
  3. Click Delete branch.

Watch below for my response.

github-learning-lab[bot] commented 3 years ago

Yay! You've done it! You've resolved all of the conflicts. I have a few pointers for completing your resume, so I've opened one last issue for that information.


Check out the final issue here!