Version Control

1. Version Control with Git via GitHub#

As you write a computer program or any other document, it is important to be able to save your work. This includes

  • saving your work at intermediate stages

  • creating multiple versions], so that you can select the option that balances the goals of being elegant (easy-to-understand), approachable (easy-to-use), and efficient (requiring less resources).

  • editing files and groups of files collaboratively in a way that minimizes conflicts/inconsistencies and maximizes teamwork/accountability.

🥅 Learning Objectives#

  • Understand what version control is and why it is useful.

  • Understand what Git is and how to use Git via GitHub.

  • Know what a repository (repo) is, and how to use a repository for version control.

  • Understand the basics of GitHub Classroom.

Version Control: Git, GitHub, and GitHub Classroom#

Version control allows you to save your work, maintain multiple versions of the same document/program in repositories, and easily go back to old versions of the document/program (if you accidentally break it or decide that you made a bad decision). It is most effective when you save (i.e., commit) your work early and often with an informative comment about the changes you made. (That makes it easy to find exactly the version you want!) Version control is essential when multiple people work on a file (or group of files) at the same time: it keeps track of who made what changes to each file, and in cases where multiple people changed the same file at the same time in mutually incompatible ways, it flags these inconsistencies so that an informed choice can be made.

Click here to learn more about various types of version control.

In this course, we use web-based version control (specifically Git and GitHub) to share material. The goal is to make it easy to share material, revise and test assignments, and discuss course content. Specifically, the course will use:

👩🏽‍💻 Assignment#

  • You will learn more about GitHub through the assignment. This includes a brief overview of GitHub terminology and links to the GitHub starter courses.

  • You will learn more about how to use GitHub Classroom and Google Colaboratory through the assignment. (This assignment is really more of a tutorial. The only programming you really need to know is that the True and False (with leading capital letter) are the Boolean values for true and false in Python, respectively. The only quantum mechanics you need to know is that Schrödinger’s cat is neither fully alive nor fully dead.


  • Sign up for GitHub Education and especially the Student Developer Pack. This gives you access to a lot of free software and tools, plus a free domain name (and free web hosting of the domain for one year).

📚 References#

You can learn more about Git and GitHub via LinkedIn Learning Courses. I have listed one, but there are many.

Hat Tip: Farnaz Heidar-Zadeh of Queen’s University. This is adapted from her orientation notes in the QC-Edu Boot Camp.