options(htmltools.dir.version = FALSE)
library(xaringanthemer)
style_mono_accent(
  base_color = "#09274B",
  base_font_size = "32px", 
  header_h1_font_size = "2.0rem",
  header_h2_font_size = "1.5rem",
  header_h3_font_size = "1.25rem", 
  header_background_content_padding_top = "2rem", 
  header_font_google = google_font("Lato"),
  text_font_google   = google_font("Montserrat", "300", "300i", "500"),
  code_font_google   = google_font("Source Code Pro", "300", "500"), 
  extra_css = list("p" = list("margin-block-start" = "0.5em", 
                              "margin-block-end" = "0.5em"), 
                   "ul" = list("margin-block-start" = "0.5em", 
                              "margin-block-end" = "0.5em"), 
                   "li" = list("margin-block-start" = "0.5em", 
                              "margin-block-end" = "0.5em"), 
                   "pre" = list("margin-top" = "0.5em", 
                              "margin-bottom" = "0.5em"), 
                   ".small" = list("font-size" = "80%")), 
  link_color = "#339944"
)

class: inverse, center, middle

r rmarkdown::metadata$title

r rmarkdown::metadata$author

r rmarkdown::metadata$institute

(updated: 2021-01-28)


Motivations


Learning Outcomes


Prerequisites

This lesson assumes you: have some familiarity making repos and commits know how to synchronize repos from your computer to GitHub


class: inverse, center, middle

Merge Conflicts


Inviting Collaborators


knitr::include_graphics("github-manage-access.png", dpi = NA)

A Simple Workflow

Two people, A and B, are working together on one repo in GitHub: A makes commits, A pushes the new commits to GitHub. B pulls the latest commits from A, works on new commits, and pushes their new commits back to GitHub. * A pulls the latest commits from B, works on new commits, etc.


What happens if you forget to pull?

You get a warning when you try to push to GitHub.

knitr::include_graphics("newer-commits-warning.png", dpi = NA)

Merging


Merging (automatically)

OR different parts of the same files - git is generally able to combine the changes without further intervention


Resolving merge conflicts

knitr::include_graphics("merge-conflict.png", dpi = NA)

Resolving merge conflicts 2


Summary


class: inverse, center, middle

GitHub Flow


Essentials of GitHub Flow

Manage work using branches - merge branches back to the primary branch when ready.

knitr::include_graphics("github-flow.png", dpi = NA)

Steps

  1. Create a branch and switch to it.
  2. Add commits with desired changes.
  3. Open a pull request (PR).
  4. Review the PR if necessary, and merge.
  5. Delete branch if done.

class: inverse, center, middle

Navigating Branches


What is a Branch?

knitr::include_graphics("git-branch.svg", dpi = NA)

.small[[img: https://www.atlassian.com/git/tutorials/using-branches]]


How do branches work?


Creating new branches (GitHub)

knitr::include_graphics("github-new-branch.png", dpi = NA)

class: center, middle

DEMO


Creating new branches (GitHub Desktop)

knitr::include_graphics("github-desktop-new-branch.png", dpi = NA)

class: center, middle

DEMO


class: inverse, center, middle

Merging Branches


Merging (branches)


class: center, middle

DEMO (GitHub Desktop)


Pull Request (GitHub)


class: center, middle

DEMO (GitHub)


class: inverse, center, middle

Community-oriented Development on GitHub


Issues


class: center, middle

DEMO


Forks


Thanks



ha0ye/RMDconverter documentation built on Feb. 4, 2021, 8:55 p.m.