Skip to content

Version Control with GitActivities & Teaching Strategies

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.

Grade 12Computer Science4 activities25 min50 min

Learning Objectives

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

Want a complete lesson plan with these objectives? Generate a Mission

30 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.

Prepare & details

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

Facilitation Tip: During 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.

Setup: Flexible workspace with access to materials and technology

Materials: Project brief with driving question, Planning template and timeline, Rubric with milestones, Presentation materials

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
45 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.

Prepare & details

What are the consequences of a poorly managed merge conflict?

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

Setup: Flexible workspace with access to materials and technology

Materials: Project brief with driving question, Planning template and timeline, Rubric with milestones, Presentation materials

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
50 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.

Prepare & details

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

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

Setup: Flexible workspace with access to materials and technology

Materials: Project brief with driving question, Planning template and timeline, Rubric with milestones, Presentation materials

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
25 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.

Prepare & details

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

Setup: Flexible workspace with access to materials and technology

Materials: Project brief with driving question, Planning template and timeline, Rubric with milestones, Presentation materials

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making

Teaching This Topic

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.

What to Expect

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.

These activities are a starting point. A full mission is the experience.

  • Complete facilitation script with teacher dialogue
  • Printable student materials, ready for class
  • Differentiation strategies for every learner
Generate a Mission

Watch Out for These Misconceptions

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

What to Teach Instead

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.

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

What to Teach Instead

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.

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

What to Teach Instead

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.

Assessment Ideas

Quick Check

After Pairs: Branching New Features, present students with a scenario: 'You added a new test file but haven’t saved it permanently. What command moves the file from untracked to staged, and what command records the change?' Collect responses to check understanding of add and commit.

Discussion Prompt

During Small Groups: Merge Conflict Resolution, pose the question: 'Your team’s branches both changed the same function. What is this situation called, and describe one visual tool and one communication strategy to resolve it?' Facilitate a class discussion using their annotated conflict scenarios.

Peer Assessment

After Individual: Personal Repo History, have students create a feature branch, make a commit with a message, and simulate a pull request. Partners review the commit message for clarity and logical change, then provide one specific suggestion for improvement using a provided rubric.

Extensions & Scaffolding

  • Challenge students who finish early to set up a protected main branch and simulate a team workflow where pull requests require approval from two peers.
  • For students who struggle, provide a pre-written conflict scenario with highlighted lines and a step-by-step resolution guide to reduce frustration.
  • Deeper exploration: Have students research and compare Git with other version control systems like Mercurial or Subversion, focusing on design differences in handling snapshots and branches.

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.

Ready to teach Version Control with Git?

Generate a full mission with everything you need

Generate a Mission