Pre-read: Merge conflicts

Milestone 1

Project

When you and your teammates work on the same lines of code within a document and try to push your changes, you may run into issues. Merge conflicts happen when you merge branches that have competing changes, and Git needs your help to decide which changes to incorporate in the final merge.

Our first task today is to walk you through a merge conflict! First, a bit of Git review:

Git will put conflict markers in your code that look like:

<<<<<<< HEAD

See also: [dplyr documentation](https://dplyr.tidyverse.org/)

=======

See also [ggplot2 documentation](https://ggplot2.tidyverse.org/)

>>>>>>> some1alpha2numeric3string4

The ======= line separates your changes (top) from their changes (bottom).

Note that on top you see the word HEAD, which indicates that these are your changes.

And at the bottom you see some1alpha2numeric3string4 (well, it probably looks more like 28e7b2ceb39972085a0860892062810fb812a08f).

This is the hash (a unique identifier) of the commit your collaborator made with the conflicting change.

Your job is to reconcile the changes: edit the file so that it incorporates the best of both versions and delete the lines beginning with <<<<<<<, =======, and >>>>>>>. In Positron, a three-way merge editor may open to help you choose or edit the result; either way, check the final text before completing the merge. Then you can render the project with Quarto: Render Project from the Command Palette, stage the changed files in the Source Control pane, commit the result, and push.