Version Control Basics

Author

Michael Rossetti

Published

2024-10-16

Demystify the version control process and learn how to manage and collaborate on coding projects with other researchers and developers. Attendees will become familiar with Git and GitHub.

Learning Objectives

  1. Discuss the importance of version control in software and research development projects.
  2. Set up a GitHub repository for version control purposes.
  3. Use GitHub Desktop software to manage the code staging and committing process, and to interface with a remote repository on GitHub.
  4. Employ Git branching strategies to manage different versions of code.
  5. Collaborate with peers by pulling and merging changes from a shared repository.
  6. Troubleshoot common Git errors and conflicts during version control.

Prerequisites

This workshop requires the following software:

  • GitHub Desktop (requires a GitHub account)
  • VS Code Text Editor

If you have never worked with these tools before, we will walk you through how to install them. Just follow the Version Control Tools Setup Guide.

Agenda

  • 0:00 - Welcome and Announcements:
    • Make sure you have already installed the prerequisite software before the workshop.
    • For all workshop exercises, beginners are encouraged to use GitHub Desktop, but any participant desiring further exploration can use the Git CLI instead.
  • 0:05 - Version Control Terminology and Concepts
  • 0:10 - “Hello Version Control” Exercise:
    • Gain familiarity with basic version control operations, including creating repositories, pushing and pulling code, and making commits.
  • 0:30 - “Pull Request Workflow” Exercise:
    • Adopt a Pull Request Workflow to collaborate with yourself (on independent projects).
  • 0:50 - “Developer Team Collaboration” Exercise:
    • Adopt a Pull Request Workflow to collaborate with teammates, on team projects where you have write access to the repository.
  • 0:70 - “Open Source Collaboration” Exercise:
    • Adopt a Pull Request Workflow to collaborate with people you don’t know, on open source projects where you don’t have write access to the repository.
  • 0:90 - Stop

The agenda above is for a 90 minute workshop, however for a 60 minute workshop, choose either the team exercise or open source exercise, and do the other for homework / self-practice.

Additional Resources

Official GitHub Docs:

Here are some additional resources for further exploration: