[1] "/Users/dp415/Desktop/exeter_open_reproducibility_website"
An introduction to version control with R Studio and GitHub
20th June 2023
here

+

+
{here}
here package worksChecked git is installed
Signed up for a GitHub account
Authenticated GitHub on your machine

Let us know if you are stuck on any of these
(Extra guidance is on the Exeter data Analytics Hub)

Why use version control?

comic: “Piled Higher and Deeper” by Jorge Cham (www.phdcomics.com)
This illustration is created by Scriberia with The Turing Way community.
Used under a CC-BY 4.0 licence. DOI: 10.5281/zenodo.3332807




Pull
Download everything from GitHub for the repo*
Stage
Add modified files to the commit queue

Commit
Confirm your changes locally (with message)

Push
Upload committed changes to GitHub


*Optional — but good practice to do when starting for the day


The R Studio git pane will only appear when you activate a project in version control

Pull

Stage


Commit


Push





* wildcard (e.g., *.png)

R Studio Projects

here
Guide to using R Studio projects can be found on the Exeter Data Analytics intros page
Guide to using R Studio projects can be found on the Exeter Data Analytics intros page
Note: You can edit/save files from a cloned repo, but won’t be able to push unless you are the repo owner or a collaborator (details here)
{here}

Illustration by Allison Horst
{here} makes filepaths that:/ or \)here::here() will show the root of your project directory:
This path is included at the start of every filepath here creates
Recommended reading: Project-oriented workflows by Jenny Bryant
here:paste():We can create a test filepath to a folder within the repository:
Create paths directly within a file/filename argument:
herepacman::p_load for loading packages– Intermission –
Why you should share your data,
why you shouldn’t share it via GitHub,
and where you should share it instead.
Matt Lloyd Jones


*Assuming you are permitted share your data
*Assuming you are permitted share your data

In the process of making your data
publication-ready, you will also
find yourself:













osfr package1




Would recommend NOT using the automated GitHub integration, because:



![]()

How to spend the rest of the time:
Clone any GitHub repo (⭐️️)
Creating a new empty GitHub repo from scratch (️⭐⭐️)
Resources: happygitwithr - new GitHub project
Turn an existing project into a GitHub repo (⭐️⭐️⭐️)
Resources: (happygitwithr — GitHub first, GitHub last)
Feel free to ask us about your pesky code problems!
