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
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
Settings
-> Manage access
Invite a collaborator
knitr::include_graphics("github-manage-access.png", dpi = NA)
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.
You get a warning when you try to push to GitHub.
knitr::include_graphics("newer-commits-warning.png", dpi = NA)
git merge
combine the changes from diverging commits:{orig}
{a}
, with changes{b}
, with changesgit merge
combines {a}
and {b}
into a new commit {c}
, that contains both sets of changes.OR different parts of the same files - git is generally able to combine the changes without further intervention
merge conflict
knitr::include_graphics("merge-conflict.png", dpi = NA)
class: inverse, center, middle
Manage work using branches - merge
branches back to the primary branch when ready.
knitr::include_graphics("github-flow.png", dpi = NA)
class: inverse, center, middle
branch
is a label for a set of commits.knitr::include_graphics("git-branch.svg", dpi = NA)
.small[[img: https://www.atlassian.com/git/tutorials/using-branches]]
knitr::include_graphics("github-new-branch.png", dpi = NA)
class: center, middle
knitr::include_graphics("github-desktop-new-branch.png", dpi = NA)
class: center, middle
class: inverse, center, middle
merge the last commit on another branch to the current branch.
switch to the branch that will keep the merged result
class: center, middle
class: center, middle
class: inverse, center, middle
class: center, middle
Pull Requests can merge from across forks.
"Fork and PR" is a common phrase indicating how one should contribute to an open-source project.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.