This week, you will be introduced to formal version control with Git, and will learn how to link up local repositories with remote counterparts on GitHub.
Be aware that Git is a rather challenging topic. Therefore, if you can, complete the main reading before Tuesday’s lecture, and also read the Buffalo chapter at some point this week.
A good way to get used to Git is to make dummy repositories where you’re just editing one or a few simple text files with dummy lines of text. That way, you can get used to the basic workflow, and freely experiment also with commands to undo things and move back in time. We’ll do this in our Zoom meetings and I recommend you do it outside of there, too.
Your first graded assignment is due on Tuesday, February 2nd, and will be about course content from this week and the first two weeks.
There is also an ungraded assignment to set up Git and authentication for Github, which you should have completed by the first lecture of the week on Tuesday, January 26th.
Some of the things you will learn this week:
Understand why you should use a formal Version Control System (VCS) for research projects.
Learn the basics of the most widely used VCS: Git.
Learn how to put your local repositories online at GitHub, and how to keep local and online (“remote”) repositories in sync.
Learn about single-user and multi-user workflows with Git and GitHub.
Learn how to use Git branches to safely make experimental changes.
Learn how to undo things and “travel back in time” for your project using Git.
This week’s main reading is the CSB chapter on Git, chapter 2. We will also roughly work our way through this chapter in the Zoom sessions.
The optional reading is the Buffalo chapter on Git, chapter 5. Like the CSB chapter, this starts with the very basics of Git; but it goes a bit further. As mentioned, Git is a challenging subject, so I recommend that you read both of these chapters to really get the hang of it.
There are also some useful further resources mentioned below.
Git-it is a small application to learn and practice Git and GitHub basics. Download and installation instructions are here.
GitHub has a nice little overview of some Git and GitHub functionality including branching and Pull Requests, and how to do these things in your browser at GitHub.
For some more background on why to use version control, and another perspective on some Git basics, I recommend the article “Excuse me, do you have a moment to talk about version control?” by Jenny Bryan.
Especially if you work with R a lot, I would recommend checking out Happy Git and GitHub for the useR, also by Jenny Bryan. This is a very accessible introduction to Git.
If you want to try some online exercises with Git with helpful visuals of what Git commands do, try https://learngitbranching.js.org/. (But be aware that this does fairly quickly move to fairly advanced topics, including several that we will not touch on in the course.)
Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".