Happy Git with R

Happy Git with R
Author

Maxwell Skinner

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.

The chapter I read was Chapter 9: Personal access token for HTTPS. The chapter focused on access tokens and the differences and uses between HTTPS versus SSH. Access tokens are important in interacting with remote Git servers like Github. Using credentials like an access token proves we are a specific Github user. Git can communicate with a remote server either through HTTPS or SSH, the different protocols use different credentials. With HTTPS you will use an access token. An access token can be made a number of ways but as simple as using the R function “usethis::create_github_token()” in the command line. SSH keys were talked about in chapter 10.

  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?.

In my final project for DS201, my team’s final project was entirely based in Google Colab. While Colab is a great resource for individual work and can be used if one is forced to use Google Drive or similar Google products, it is not great for organizing work accross multiple people. There were many issues that came with storing files in google drive and importing them into a script in Colab. As well, my team couldn’t ever figure out how to correctly mount each individual’s google drive to the project to be able to import things like excel files so we were forced to do the majority of work from just one computer instead of doing work equally accross everyone.

Using git would have solved this issue completely. Sharing files and making sure everyone is working with the same version of a file would have been solved simply by using git. Importing something as simple as an excel file is easy as the we can put the script and the excel file in the same folder for easy access. Github has made group projects now an ease. Minimal hiccups when it comes to productivity and having teammates work on the same file from different locations.

  1. Give an example of one new git feature that you learned about from Jenny Bryan’s book..

In Chapter 9, Jenny talks about the R function “usethis::create_github_token()” which is used to get and store a personal access token. And using a R package such as gitcreds, we can store this generated token locally onto your computer. This is great for working with remote servers and kinds of Github servers that require tokens. As with the changes in July 2020 detailed in this article github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ , the only way to access Git operations is through token authentication.