Teaching Git

I’ve helped out or taught at a handful of Software Carpentry (SWC) workshops over the past year, and every time, I felt that students were forgetting about Git as soon as they walked out of the room at the end of the second day. There always seems to be a general confusion that cannot be dispelled during the Git lessons. While this may be partially caused by inexperienced instructors, I would argue that it can mostly be attributed to the current lesson material, referred to here as the Planets lesson. Not only does it not properly demonstrate Git’s usefulness in a real-world scenario, but it fails to engage the audience, which is especially crucial for teaching something as unintuitive as Git. My typical workshop audience are academic researchers, and I’m pretty sure they don’t give a shit about Wolfman’s and Dracula’s thoughts on Mars, which is the Planets lesson narrative. To be clear, I mean no offense to the lesson designers and maintainers, whose work I fully appreciate; I just think there’s much room for improvement.

In September 2015, I gave a short workshop on setting up one’s online presence using GitHub Pages as part of the SciProg study group I help organize. While discussing with Bill Mills, we realized that this lesson could also serve as an introduction to Git. We thought that the creation of a blog would be both engaging and relevant to learners. I decided to test this hypothesis by teaching a modified version of the Git lesson at a SWC Python workshop in February 2016. This post details my experience with this new approach. You can find my modified lesson here and the GitHub repository here. Feel free to open GitHub issues with comments and suggestions!

Briefly, I used the Jekyll Now blog template. In my original lesson, I had learners fork the template repository. However, I didn’t want to introduce an intermediate Git topic at the outset of the SWC lesson. So, I had learners download the template as a compressed ZIP folder instead. Like many other templates, Jekyll Now has a simple configuration file (_config.yml) that was the focus of the first commits (e.g. customize the name and blog description). The topic of ignoring things used the example of a drafts folder and a TODO.txt file. Pushing to GitHub has the bonus of making their blog live on the Internet, which learners always find cool to witness. Collaboration and conflict resolution used the realistic situation of a guest blog post. Finally, all learners were given a custom Git cheat sheet of commands covered in the lesson. Most cheat sheets available online are too comprehensive and would be overwhelming. So, I created a simple cheat sheet, which was popular among the learners.

Overall, I believe the new lesson format was more effective at teaching Git. Subjectively, more learners were “getting it” compared to previous workshops I’ve helped with. In fact, at the end of the lesson, some were asking how they could use Git for their own projects, which I had never witnessed before. Anecdotally, one learner had previously participated in another SWC workshop and commented that the Git lesson I taught was “way better”. In general, the feedback on the lesson was either positive or they wanted more information about Git and/or GitHub Pages, which I perceive as a win! Based on this one workshop, it seems that teaching Git using GitHub Pages is a definitive improvement over the current SWC lesson material.

I think there are a few reasons why my new lesson is better. First, building a personal blog is relevant and engaging for most learners, unlike the Planets lesson. In turn, increased engagement makes it easier to teach Git’s somewhat unintuitive concepts. Second, the tasks performed by learners are more meaningful. I found that learners often get lost with successively appending lines of text to the mars.txt file in the Planets lesson. I think the root cause of this is that they don’t see the point and/or aren’t invested in the task at hand. This is mostly resolved when they’re working on their personal blog. Third, learners experience near instant gratification when they see their blog updated online as they push their commits. This reward keeps them interested in the lesson. I’ve also noticed significantly higher levels of enthusiasm in the room and patience when facing issues. Fourth, by getting learners started with their personal blogs using GitHub Pages, it theoretically locks them into using Git if they want to continue updating it in the future. To be fair, I haven’t looked at the percentage of blogs that have been updated beyond the lesson I gave, so this may be irrelevant. I didn’t collect GitHub usernames, and I don’t know if I should for determining long-term Git usage, even if the repositories are public. Maybe we can ask for permission during or after the workshop.

Admittedly, there are some disadvantages of this approach. The instant gratification I mentioned earlier is contingent on a quick refresh rate on GitHub’s end. In my experience, blog updates are published within a few minutes, but this cannot be guaranteed. One alternative is to preview the Jekyll blog locally. While this may be simple on OS X and Linux machines, it’s a more involved process for Windows computers. Another concern is the introduction of two new concepts, Markdown and Jekyll, which adds cognitive load that doesn’t exist in the Planets lesson. I concede that this is a trade-off made in my lesson, but I would argue that the benefits outweigh the risks. I actually avoided the discussion of Markdown during the lesson and got away with treating Markdown files as plain text. Similarly, I went with a Jekyll blog template instead of covering Jekyll itself during the workshop. Finally, while creating a blog is more relevant to learners than the Planets lesson, researchers still wondered how they can apply Git to their own projects. For instance, many expressed interest in using Git for tracking changes in Word documents, which I know Git doesn’t excel at and had no good answer for. Therefore, there is a need to develop a transition between the GitHub Pages lesson and more practical use cases of Git that are particularly relevant to researchers, which constitute my typical target audience.

Despite these drawbacks, I firmly believe the use of GitHub Pages for teaching Git is a clear step forward from the Planets lesson. Caveats for this blog post include that I actually never taught Git using the Planets lesson; I’ve only ever witnessed it being taught by someone else. Also, keep in mind that this is based on one workshop experience and might not be generalizable. I would love to see a discussion surrounding improvements that could eliminate some of the disadvantages I mentioned above. I’m also open to hearing about potential problems I haven’t thought about. You can leave your comments below or open an issue on the GitHub repository. And if ever you get a chance to teach Git using GitHub Pages, I’m eager to hear whether your experience reflects mine, and if not, what was different when you taught it.


If you liked this post, you can share it on Twitter and/or follow me for more updates!

teaching, opinion