Happy Git with R

Happy Git with R
Author

Marie Hardt

Published

February 2, 2023

Prompt:

git and Github are tools for helping with versioning of files in collaborative efforts as well as archiving entries for your future self. Unfortunately working with git isn’t always completely straightforward. Jenny Bryan’s book “Happy git and github with R” helps with that. The book is available from http://happygitwithr.com/. Have a look over the index and pick one of the chapters for a more in-depth read.

Write a blog post answering the following questions:

  1. Write a short (100-150 words) summary of the chapter you read in-depth.

I read Chapter 12: Connect RStudio to Git/GitHub. To have RStudio and GitHub communicate with each other, you should start with a new repository on GitHub that is initialized with a README. Then you need to copy a link to the GitHub repository, either HTTPS or SSH (whichever you prefer). Once everything is set up in GitHub, you move to RStudio and create a new project with version control. Then you paste the URL for your GitHub repository into the “Repository URL” box in RStudio and finish the project creation process. Assuming everything went smoothly, you should be able to see the README.md file from GitHub in your RStudio project. To further make sure everything is set up correctly, you can change the README.md file in RStudio, commit the changes, and push them to GitHub. If the changes appear in GitHub online, you’re good to go!

  1. Looking back at all of the team projects you have been involved in, describe the biggest mishap you had. Could that have been avoided using git? How?.

I have experienced a common inconvenience in several group projects and group homework assignments in my graduate statistics classes. The assignments usually involved writing a report or showing our work and including R code. If there hadn’t been the requirement to include R code, we probably would have used a collaboration tool like Overleaf to write the report. Since we also had to include working R code, this meant the groups preferred to work with RMarkdown files. After deciding which group member would type each question, we would each work on our own individual RMarkdown file, send them to each other when we were finished with our work, and then copy and paste everyone’s work into one file for submission. Using git would have been a lot easier because all group members could have been able to see each other’s work sooner. Combining the work into one file also would have been much simpler with git.

  1. Give an example of one new git feature that you learned about from Jenny Bryan’s book.. I learned that you can connect RStudio to GitHub using HTTPS instead of SSH. When I last worked with RStudio and GitHub together (a few years ago), I thought you could only connect the two using SSH. The HTTPS method seems much easier.