Collaboration with Version Control: Git and GitHub

Does this happen to you? What about bouncing files back and forth amongst collaborators through email? Or even keeping track of your own files between multiple devices?

Do you currently have a way of handling these sometimes frustrating scenarios? Any horror stories?

[I developed and delivered this mini-lesson as part of instructional skills training at UBC]

Learning Outcomes

Version control is a powerful solution to these regular dilemmas. By the end of this very brief lesson, learners are anticipated to:

  • Understand the central concepts and values of version control
  • Identify areas of your own work that can benefit from version control
  • Name the prominent version control software, and one prominent cloud-based hosting service

What is Version Control? Git?

Version control is a widely used solution for keeping track of files between devices and collaborators over time. The most prominent software is called “git”.

I like to think of git as the next level to saving a file. Just like regular file saving has (hopefully) become a regular part of your workflow, version control requires you to regularly make snapshots of your files. These snapshots are called commits.

Save like crazy. Commit frequently.

Though, commits aren’t really “snapshots”. Git doesn’t actually store an entire copy of your file each time you commit! Only the changes (or diffs) are stored, so there’s no need to sweat any storage demands!

What is GitHub?

There are cloud-based services that provide both file storage and a nice interface for git built into them. Perhaps the most prominent of these services is GitHub (others are Bitbucket and GitLab). The added step here is to push changes from your computer up to GitHub.

Save like crazy. Commit frequently. Push before you’re interrupted by a fire.

How exactly are my versioning and collaboration problems solved?

In many ways!

  • Easily identify changes: file changes are highlighted by GitHub. No more detective work to see exactly what was changed in a file.
  • Retrievable history: you can easily reconstruct your files as they were at any point along the commit history.
    • No more need to keep loads of file versions!
  • No more uncertainty as to who has the most up-to-date files. They’re on GitHub!

Personally, I’ve been using GitHub more and more, if only for the peace of mind of having a retrievable history, and a record of how my thoughts progress over time. And maybe it’s just me, but I also find that dedicating myself to committing keeps me focussed, because they force me to think about what I’m doing (instead of just doing it).

Other tools

Although git and GitHub always work, they work best with plain-text files. If you work with the Office suite of tools like Word, you should first of all consider whether you should really be using this. If you still want to use Office, then perhaps consider options built into the Office tools, or Google docs.

Back to you

What areas of your own life could benefit from version control with Git and GitHub?

Check your email inbox for emails with attachments to get a sense of the areas of your life that might benefit from version control.

Next time you go to transfer a file, be mindful of the cognitive load that comes with the file transfer. You might be better off using a version control system like git and GitHub.

Learning More

If you want to learn more, I recommend starting with a cloud-based service like GitHub. It’s a gentle introduction to the subject, and is easier to use than plain git, and has plenty of helpful guides.

Vincenzo Coia
he/him/his 🌈 👨

I’m a data scientist at the University of British Columbia, Vancouver.

comments powered by Disqus