Skip to content
Software Engineering Principles · Term 4

Version Control with Git

Using industry-standard tools to track changes and collaborate on shared codebases.

Need a lesson plan for Computer Science?

Generate Mission

Key Questions

  1. How does version control facilitate collaboration among hundreds of developers on one project?
  2. What are the consequences of a poorly managed merge conflict?
  3. How can we use branching to experiment with new features without breaking the main product?

Ontario Curriculum Expectations

CS.SE.11CS.PM.5
Grade: Grade 12
Subject: Computer Science
Unit: Software Engineering Principles
Period: Term 4

About This Topic

Version control with Git enables developers to track code changes, collaborate on shared projects, and recover from errors efficiently. Grade 12 students master core commands such as init, add, commit, push, pull, branch, and merge. They explore how Git repositories store history as a series of snapshots, allowing multiple contributors to work simultaneously without conflicts. This topic addresses key questions about scaling collaboration to hundreds of developers, resolving merge conflicts, and using branches for safe experimentation.

In the Ontario Computer Science curriculum, Git aligns with software engineering principles (CS.SE.11) and project management (CS.PM.5). Students apply these tools to simulate professional workflows, fostering skills in debugging, teamwork, and iterative development. Understanding Git's distributed nature helps them appreciate how open-source projects like Linux succeed through coordinated contributions.

Active learning shines here because students experience real merge conflicts and branching outcomes firsthand. Pair programming on shared repos or group simulations of pull requests turns abstract commands into tangible team dynamics, building confidence and retention through trial and error in a safe environment.

Learning Objectives

  • Demonstrate the use of Git commands (init, add, commit, push, pull, branch, merge) to manage a code repository.
  • Analyze the history of a Git repository to identify changes made by collaborators.
  • Compare and contrast the outcomes of different branching strategies for feature development.
  • Critique a pull request, providing specific feedback on code changes and adherence to project standards.
  • Create a new branch, implement a small feature, and merge it back into the main branch.

Before You Start

Basic Command Line Interface (CLI) Usage

Why: Students need to be comfortable navigating directories and executing commands to use Git effectively.

File Management and Organization

Why: Understanding how files and folders are structured is essential for managing code within a repository.

Key Vocabulary

Repository (Repo)A project's storage location for all its files and version history, managed by Git.
CommitA snapshot of the repository at a specific point in time, along with a message describing the changes made.
BranchAn independent line of development within a repository, allowing for parallel work without affecting the main codebase.
Merge ConflictA situation that occurs when Git cannot automatically combine changes from different branches, requiring manual resolution.
Pull Request (PR)A formal request to merge changes from one branch into another, typically used for code review and discussion before merging.

Active Learning Ideas

See all activities

Real-World Connections

Software developers at Google use Git to manage the codebase for projects like Android, coordinating contributions from thousands of engineers worldwide.

Game development studios like Ubisoft employ Git for version control of game assets and code, enabling large teams to collaborate on complex projects like Assassin's Creed.

Open-source projects, such as the Linux kernel, rely heavily on Git and pull requests to manage contributions from a global community of volunteer developers.

Watch Out for These Misconceptions

Common MisconceptionGit branches create full copies of the entire codebase.

What to Teach Instead

Branches are lightweight pointers to commits, saving space and enabling fast switches. Hands-on branching activities let students time branch creation versus copying files, revealing efficiency. Group merges reinforce that branches share history until divergence.

Common MisconceptionMerge conflicts only happen with poor coding.

What to Teach Instead

Conflicts arise from simultaneous edits to the same lines, regardless of code quality. Simulating conflicts in pairs helps students practice resolution tools like git mergetool. Discussions clarify that communication prevents most issues.

Common MisconceptionGit is only for large teams, not solo developers.

What to Teach Instead

Solo devs use Git for backups, experimentation, and history. Individual repo setups show students how to revert mistakes safely. This builds habits before team projects.

Assessment Ideas

Quick Check

Present students with a scenario: 'You just finished writing a new function. What Git command do you use to stage it, and what command do you use to save it permanently?' Review responses to gauge understanding of basic add and commit actions.

Discussion Prompt

Pose the question: 'Imagine two developers modify the same line of code on different branches. What is this called, and what are two strategies to resolve it?' Facilitate a class discussion on merge conflicts and their resolution methods.

Peer Assessment

Students create a simple feature branch, make a commit, and then initiate a pull request (simulated or actual). Their partner reviews the pull request, checking for a clear commit message and a logical change, then provides one specific suggestion for improvement.

Ready to teach this topic?

Generate a complete, classroom-ready active learning mission in seconds.

Generate a Custom Mission

Frequently Asked Questions

How does Git facilitate collaboration on large projects?
Git uses branches and pull requests to let hundreds contribute safely without overwriting main code. Developers fork repos, test changes, and merge via reviews. This structure, as in Linux kernel, ensures stability. Students simulate via class repos to see coordination in action, linking to CS.SE.11 standards.
What are the consequences of poorly managed merge conflicts?
Unresolved conflicts lead to broken code, lost work, or integration delays, eroding team trust. In extreme cases, like production bugs, they cause outages. Teaching resolution through group activities equips students to communicate changes early, aligning with project management skills in CS.PM.5.
How can active learning help students master Git?
Active approaches like pair branching and group merge simulations immerse students in real workflows, making commands memorable. They resolve conflicts hands-on, discuss pull requests, and track repo evolution collaboratively. This beats lectures by building muscle memory and problem-solving confidence in 40-50 minute sessions.
What are essential Git commands for beginners?
Start with git init, clone, add, commit, status, push, pull, branch, checkout, and merge. Practice sequences like commit-push-pull daily. Use visual tools like GitHub Desktop initially, then CLI for depth. Activities reinforce via checklists, ensuring fluency for software engineering tasks.