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:
- Write a short (100-150 words) summary of the chapter you read in-depth. Question 1: (I read the chapter 22, “Branches”)
My answer: Basically, branching is used to take a detour from the main stream to work on the code without making any instant changes to the source file. This characteristic lets people work at the same time on the project without any conflicts or errors. To use this feature, we should create a new branch. One person may or may not create multiple branches; in this case, the person can use “git checkout” to switch between the branches. One important point is that when we switch to another branch while we are not done with the other branch(es), we should commit the in progress branch temporarily. When we want to resume working on the incomplete branch, we should reset the target branch. It worth to mention that there are different type of resetting such as soft, hard, and mixed that help resetting back to different past stages of the interest. Finally, we can merge the complete branch. If we want to merge more than one branches, it is possible to see the conflict message if we have changed the same part in the both branches. In this situation, we can get the status and check the conflict easily. Also, we always can go back to the previous stages of the branch to check and do the revisions accordingly. 2. 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?. Question 2: My answer: I think one of the biggest challenge that I experienced during my Ph.D. in team working was that we had to work individually on our ideas and we could not document everyone’s work properly. Also, we did not access to each others works while we were working. Another problem was in the review process of each others work; if one might change something based on another person’s feedback, the change was not tracked easily. The advantage of working with fit is that everyone work in one repository, save everything in one location, always accessible for other team members, easy to review other people’s work, easy to track changes. 3. Give an example of one new git feature that you learned about from Jenny Bryan’s book..
Question 3: My answer: I found the branch option very useful for collaborations! suppose our team is working on a competition which is a classification problem. There is a source code that applied a random forest model and got an average classification performance. Now, I guess that I can improve the model by tuning the hyper parameters with either Bayesian optimization or grid search. I can easily create two branches; one for examination of Bayesian optimization, another for implementation of the grid search. In this case, I can work on the two ideas separately without any changes in the source file, test the both ideas, pick the best one, and merge the final version.