Skip to content
Computer Science · Grade 9

Active learning ideas

Version Control with Git (Basic)

Active learning helps students grasp Git commands by doing them in real time, which builds muscle memory and confidence with version control. Pair and group work mirror real-world software teams, making abstract concepts like commits and pushes tangible.

Ontario Curriculum ExpectationsCS.HS.AP.16CS.HS.CT.17
20–45 minPairs → Whole Class4 activities

Activity 01

Pair Practice: Shared Repo Setup

Pairs create a GitHub repo, clone it locally, then take turns editing a shared HTML file: one adds content and commits, the other pulls, modifies, and pushes. Discuss conflicts if they arise. End with viewing the commit history online.

Explain the benefits of using version control systems like Git in software development.

Facilitation TipDuring Pair Practice, circulate to ensure both partners take turns initiating repos and pushing changes, reinforcing shared ownership of the workflow.

What to look forPresent students with a scenario: 'You have made changes to your code and want to save them locally before starting a new feature. What two Git commands would you use in order?' Ask students to write the commands and a brief explanation for each.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 02

Collaborative Problem-Solving45 min · Small Groups

Small Group Workflow: Game Collaboration

Groups of four divide a simple JavaScript game project into features (e.g., player movement, scoring). Each member branches, codes their part, commits locally, then merges via pull requests. Review history as a group.

Differentiate between committing, pushing, and pulling changes in Git.

Facilitation TipFor Small Group Workflow, provide a clear timeline: 10 minutes to plan, 15 minutes to code, 10 minutes to resolve a merge conflict using git pull and git merge.

What to look forFacilitate a class discussion using the prompt: 'Imagine you and a partner are working on the same file. You both make different changes and then try to push your work. What might happen, and how would Git help you resolve this situation?'

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 03

Collaborative Problem-Solving25 min · Whole Class

Whole Class Challenge: Version Detective

Class clones a pre-made repo with a bugged codebase. Instruct students to use git log and git checkout to explore past versions, identify the error introduction, and revert. Debrief on prevention strategies.

Construct a workflow for collaborating on a coding project using basic Git commands.

Facilitation TipIn the Whole Class Challenge, ask students to present their findings with git log --graph visible on the projector to highlight branch structure.

What to look forProvide students with a card asking them to define 'commit' in their own words and explain why it is different from 'push'. They should also list one situation where they would use 'pull'.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 04

Collaborative Problem-Solving20 min · Individual

Individual Drill: Local Repo Mastery

Students initialize a personal repo, make five iterative changes to a Python script (e.g., add functions), committing each with descriptive messages. Practice git status and git diff to check progress before final push.

Explain the benefits of using version control systems like Git in software development.

Facilitation TipFor Individual Drill, give students a checklist of commands to practice in sequence: git init, git add, git commit, git status, and git log.

What to look forPresent students with a scenario: 'You have made changes to your code and want to save them locally before starting a new feature. What two Git commands would you use in order?' Ask students to write the commands and a brief explanation for each.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

A few notes on teaching this unit

Teach Git step-by-step with frequent checks for understanding, as rushing to advanced commands before mastering basics leads to confusion. Use analogies like 'commits are snapshots in time' and 'push is like mailing a letter to share your work.' Avoid covering remotes before local commits are solid; students need to see the difference between saving locally and sharing remotely.

Successful learning looks like students confidently initializing repos, committing changes, pushing to remotes, and pulling updates without prompts. They should explain why local changes aren’t shared until pushed and how branches allow safe experimentation.


Watch Out for These Misconceptions

  • During Pair Practice, watch for students assuming commits automatically appear online for their partner.

    Pause the activity after the first commit and ask partners to check git log before pushing. Have them observe that the remote repo remains empty until git push is run, making the local-remote gap concrete.

  • During Small Group Workflow, watch for students treating Git as a single-user backup tool.

    After the group shares their files via remote, ask each student to point out whose changes were added by whom. Use git log --author to highlight individual contributions and emphasize collaboration.

  • During Whole Class Challenge, watch for students believing branches create separate, isolated projects.

    Before starting, have students sketch a simple git log --graph on paper. During the activity, ask them to trace how changes from a feature branch rejoin the main branch, visualizing the merge process in real time.


Methods used in this brief