class: center, middle, inverse, title-slide # Data Visualization ## Collaboration with GitHub ### Andrew Irwin,
a.irwin@dal.ca
### Math & Stats, Dalhousie University ### 2021-02-22 (updated: 2021-02-08) --- class: middle # Plan * Collaborating with GitHub and Rstudio * How editing conflicts arise * Resolving editing conflicts * Other workflows --- class: inverse, middle ## Using the team-planning repository <img src="../static/collaboration-01.png" width="90%" style="display: block; margin: auto;" /> --- class: middle ### Scenario * Two people have cloned the repository to their computer and are both editing the same file .pull-left[ <img src="../static/collaboration-02-rstudio-cloud-student.png" width="100%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="../static/collaboration-02-airwin.png" width="100%" style="display: block; margin: auto;" /> ] --- class: middle ### One person pushes a change to GitHub * What happens when the second person tries to push a change? <img src="../static/collaboration-03-conflict.png" width="90%" style="display: block; margin: auto;" /> --- class: middle ### One person pushes a change to GitHub * What happens when the second person tries to push a change? <img src="../static/collaboration-03-resolution.png" width="90%" style="display: block; margin: auto;" /> --- class: middle ### Later, the other user pulls the changes <img src="../static/collaboration-04-result.png" width="90%" style="display: block; margin: auto;" /> --- class: middle ### Conflicting edits on the same line can't be resolved automatically .pull-left[ <img src="../static/collaboration-05-conflict-1.png" width="100%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="../static/collaboration-05-conflict-A.png" width="100%" style="display: block; margin: auto;" /> ] --- class: middle ### Conflicting edits on the same line can't be resolved automatically <img src="../static/collaboration-06-message.png" width="90%" style="display: block; margin: auto;" /> --- class: middle ### Pull, edit, stage, commit, push <img src="../static/collaboration-07-resolution.png" width="90%" style="display: block; margin: auto;" /> --- class: middle # Summary * The pull - edit - commit - push editing workflow * Non-conflicting "simultaneous" edits * Conflicting simultaneous edits on the same line and how to resolve them * Commit to local repository * Pull remote changes * Resolve conflicts * Stage, commit, and push changes --- class: middle # Further reading * Course notes * [Collaboration tutorial](https://uoftcoders.github.io/studyGroup/lessons/git/collaboration/lesson/) linked in course notes * [Resolving merge conflicts on GitHub](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-using-the-command-line) --- class: middle, inverse ## Task Task 11: Add your name to the collaboration list, as part of a team, or by yourself. People not in teams will be assigned teams randomly. Resolve any conflicts that arise -- for example, two people using the same line of the table.