Skip to content
Computer Science · Grade 12

Active learning ideas

Version Control with Git

Active learning works for this topic because Git commands are procedural skills that require hands-on practice to move from theory to muscle memory. Students need to experience the immediate feedback loop of branching, editing, and merging to grasp how snapshots and references operate. Collaborative tasks mirror real-world workflows, making abstract concepts concrete and memorable.

Ontario Curriculum ExpectationsCS.SE.11CS.PM.5
25–50 minPairs → Whole Class4 activities

Activity 01

Project-Based Learning30 min · Pairs

Pairs: Branching New Features

Students clone a shared class repository, create a feature branch, add and commit a simple function, then push it. Partners review via pull request, merge to main, and discuss changes. End with a class share-out on branch benefits.

How does version control facilitate collaboration among hundreds of developers on one project?

Facilitation TipDuring Pairs: Branching New Features, circulate to listen for students describing branches as 'copies' and redirect by asking them to compare branch creation time with file duplication time.

What to look forPresent 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.

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
Generate Complete Lesson

Activity 02

Project-Based Learning45 min · Small Groups

Small Groups: Merge Conflict Resolution

Groups edit the same file on separate branches, intentionally create conflicts by changing overlapping lines, then resolve using git merge and editor tools. Record steps in a shared doc. Debrief on prevention strategies.

What are the consequences of a poorly managed merge conflict?

Facilitation TipFor Small Groups: Merge Conflict Resolution, provide a printed conflict scenario so groups can annotate it together before opening terminals, reducing cognitive load.

What to look forPose 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.

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
Generate Complete Lesson

Activity 03

Project-Based Learning50 min · Whole Class

Whole Class: Collaborative Code Base

Class contributes to one repo: assign roles like feature dev, reviewer, integrator. Use issues for tasks, pull requests for changes. Monitor progress live via projector, vote on merges.

How can we use branching to experiment with new features without breaking the main product?

Facilitation TipWhen running Whole Class: Collaborative Code Base, assign specific roles like pull request reviewer or merge manager to ensure every student engages with the workflow.

What to look forStudents 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.

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
Generate Complete Lesson

Activity 04

Project-Based Learning25 min · Individual

Individual: Personal Repo History

Students initialize a repo, make 10 commits with messages, create branches, and explore git log and reflog. Revert a 'bad' commit. Reflect on history tracking value in a journal.

How does version control facilitate collaboration among hundreds of developers on one project?

What to look forPresent 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.

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
Generate Complete Lesson

A few notes on teaching this unit

Experienced teachers approach this topic by starting with local commands before introducing remotes, so students master the fundamentals without network complications. Use analogies students can relate to, such as comparing branches to alternate endings in a story, but transition quickly to concrete commands. Emphasize that mistakes are expected and recoverable, which reduces anxiety around merge conflicts. Research shows that students retain procedural skills better when they teach concepts to peers, so pair discussions are essential.

Successful learning looks like students confidently using Git commands to manage a shared codebase without fear of errors. They should explain why branches exist, resolve merge conflicts independently, and justify their commit messages as clear records of changes. The goal is for students to see Git as a tool for safety and teamwork, not just a requirement.


Watch Out for These Misconceptions

  • During Pairs: Branching New Features, watch for students saying that a new branch duplicates the entire project folder.

    Have students time how long `git branch new-feature` takes versus copying the folder, then print the commit history to show branches share history until divergence. Ask them to explain why this matters for large projects.

  • During Small Groups: Merge Conflict Resolution, watch for students blaming poor coding practices when conflicts occur.

    Provide a scenario where two well-written features conflict, then have groups use `git mergetool` to resolve it. Afterward, discuss how communication before coding could have prevented the conflict.

  • During Individual: Personal Repo History, watch for students believing Git is only useful for teams.

    Ask students to revert a commit in their personal repo and explain how this skill prevents lost work. Have them list daily tasks where Git would be helpful, even solo.


Methods used in this brief