e-learning

Version Control with Git

Abstract

Version control is a way of tracking the change history of a project, and git is one of the most popular systems for doing that! This tutorial will guide you through the basics of using git for version control.

About This Material

This is a Hands-on Tutorial from the GTN which is usable either for individual self-study, or as a teaching material in a classroom.

Questions this will address

  • What is version control and why should I use it?
  • How do I get set up to use Git?
  • Where does Git store information?
  • How do I record changes in Git?
  • How do I check the status of my version control repository?
  • How do I record notes about what changes I made and why?
  • How can I identify old versions of files?
  • How do I review my changes?
  • How can I recover old versions of files?

Learning Objectives

  • Understand the benefits of an automated version control system.
  • Understand the basics of how automated version control systems work.
  • Configure git the first time it is used on a computer.
  • Understand the meaning of the --global configuration flag.
  • Create a local Git repository.
  • Describe the purpose of the .git directory.
  • Go through the modify-add-commit cycle for one or more files.
  • Explain where information is stored at each stage of that cycle.
  • Distinguish between descriptive and non-descriptive commit messages.
  • Explain what the HEAD of a repository is and how to use it.
  • Identify and use Git commit numbers.
  • Compare various versions of tracked files.
  • Restore old versions of files.

Licence: Creative Commons Attribution 4.0 International

Keywords: Foundations of Data Science

Target audience: Students

Resource type: e-learning

Version: 6

Status: Active

Learning objectives:

  • Understand the benefits of an automated version control system.
  • Understand the basics of how automated version control systems work.
  • Configure git the first time it is used on a computer.
  • Understand the meaning of the --global configuration flag.
  • Create a local Git repository.
  • Describe the purpose of the .git directory.
  • Go through the modify-add-commit cycle for one or more files.
  • Explain where information is stored at each stage of that cycle.
  • Distinguish between descriptive and non-descriptive commit messages.
  • Explain what the HEAD of a repository is and how to use it.
  • Identify and use Git commit numbers.
  • Compare various versions of tracked files.
  • Restore old versions of files.

Date modified: 2023-10-23

Date published: 2022-07-06

Authors: Sofoklis Keisaris

Contributors: Fotis E. Psomopoulos, Helena Rasche, Saskia Hiltemann

Scientific topics: Software engineering

External resources:

Activity log