Happy Git with R

Happy Git with R
Author

Harun Celik

Published

February 5, 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.

My answers:

  1. While I learned new things from all the chapters I had an interest in checking, I especially found the “Resetting” chapter to be resourceful. Simply, there are three methods for resetting a commit. The git reset ---hard HEAD^ will undo everything, losing all changes. The git reset HEAD^ will only undo the commit and clear the stage but your files stay the same. Finally git reset --soft HEAD^ will undo the commit and restore the staged changes. If the intention is to change the earlier message, there is also a possibility to amend recent commit messages by using git commit --amend -m "New commit message". Resetting is an important component to commit’s because we all make committing mistakes in our projects and these offer an alternative to “burning it all down.”

  2. I think the biggest mishap has always been not taking enough time to properly design the workflow that we wanted to use as a team. We would have one directory in Box, another in Github and people would start using their own local files for work without committing and since some branched and others didn’t, Git would have a difficult time understanding our project. An effort I want to make moving forward is really detailing exactly how we want to move forward with workflow and incorporating everyone’s ideas on workflow flexibility as projects evolves.

  3. I did not know about the --amend command. I also only recently learned about the different reset options after I made mistakes to a repository that I burned down (but didn’t have to had I known about these commands ahead of time).