Skip to content

Version Control with GitActivities & Teaching Strategies

Version control is a procedural skill that improves with hands-on practice. Active learning lets students experience the immediate consequences of their Git commands, turning abstract concepts like staging and merging into concrete actions they can see and correct.

11th GradeComputer Science4 activities20 min40 min

Learning Objectives

  1. 1Demonstrate the use of Git commands (init, add, commit, push, pull, branch, merge) to manage code versions in a personal project.
  2. 2Analyze a Git log to identify the sequence and authorship of changes within a collaborative repository.
  3. 3Compare and contrast the outcomes of merging branches with and without conflicts.
  4. 4Create a new branch in a Git repository, make changes, and merge it back into the main branch.
  5. 5Explain the purpose of a .gitignore file in excluding specific files from version control.

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

25 min·Small Groups

Simulation Game: Git History as a Timeline

Before touching computers, groups act out a version control scenario using index cards as 'commits.' Each student makes a change to a paper document, writes a commit message on a card, and passes it to the next. Groups then 'branch,' make diverging changes, and attempt to 'merge' by hand. Debrief connects the physical experience to Git commands.

Prepare & details

Explain the importance of version control systems like Git in collaborative development.

Facilitation Tip: During the Git History as a Timeline activity, have students physically arrange sticky notes on a wall to represent commits, so they can see how branches diverge and merge over time.

Setup: Flexible space for group stations

Materials: Role cards with goals/resources, Game currency or tokens, Round tracker

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
40 min·Pairs

Collaborative Lab: Intentional Merge Conflict

Pairs work on the same repository and intentionally edit the same line in different branches. They then attempt to merge and resolve the resulting conflict together. Each pair documents what caused the conflict, how they resolved it, and what they would do differently to avoid it next time.

Prepare & details

Differentiate between common Git commands (commit, push, pull, branch, merge).

Facilitation Tip: In the Intentional Merge Conflict lab, deliberately assign conflicting changes to pairs so they must use pull and merge tools, reinforcing that conflicts are part of normal 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
20 min·Pairs

Think-Pair-Share: Commit Message Quality

Show students five commit messages ranging from unhelpful ('fixed stuff') to professional and specific. Partners rank them and explain their reasoning. Share rankings as a class and co-create a rubric for good commit messages. Students then rewrite the poor examples using the rubric.

Prepare & details

Analyze how Git helps manage conflicts and maintain code integrity in a team environment.

Facilitation Tip: For the Commit Message Quality think-pair-share, provide examples with vague and clear messages, then ask pairs to revise them together before whole-class sharing.

Setup: Standard classroom seating; students turn to a neighbor

Materials: Discussion prompt (projected or printed), Optional: recording sheet for pairs

UnderstandApplyAnalyzeSelf-AwarenessRelationship Skills
30 min·Small Groups

Gallery Walk: Git Workflow Diagrams

Post four workflow diagrams around the room showing different branching strategies (feature branches, main-only, gitflow). Student groups annotate each with pros, cons, and what team size or project type it suits best. Close with a discussion of which workflow their class project should use and why.

Prepare & details

Explain the importance of version control systems like Git in collaborative development.

Setup: Wall space or tables arranged around room perimeter

Materials: Large paper/poster boards, Markers, Sticky notes for feedback

UnderstandApplyAnalyzeCreateRelationship SkillsSocial Awareness

Teaching This Topic

Teach Git in small, frequent steps with frequent feedback loops. Avoid long lectures about theory; instead, pair explanations with live demonstrations followed by student attempts. Research shows that students retain procedural skills when they practice commands immediately after seeing them used. Emphasize consistency in commit messages and branch naming to build professional habits early.

What to Expect

Students will demonstrate the ability to stage, commit, branch, and resolve conflicts independently. They will explain why these steps matter in real projects and use clear commit messages to document their work.

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 the Git History as a Timeline activity, watch for students assuming their edits are saved just because they see them in the editor.

What to Teach Instead

Pause the activity and ask students to run `git status` after each edit to see that Git only tracks changes once they are staged and committed. Use this moment to reinforce the workflow: edit → stage → commit.

Common MisconceptionDuring the Intentional Merge Conflict lab, watch for students treating merge conflicts as errors that break their project.

What to Teach Instead

After the lab, have students describe how they resolved the conflict step-by-step. Ask them to explain why resolving conflicts is a routine part of development rather than a failure.

Common MisconceptionDuring the Commit Message Quality think-pair-share, watch for students writing commit messages like 'fixed stuff' or 'did work'.

What to Teach Instead

Display the lab’s commit history and ask pairs to rewrite vague messages to include what was changed and why. Provide a rubric with examples of good and bad messages.

Assessment Ideas

Quick Check

After the Intentional Merge Conflict lab, present students with a scenario: 'You are on the main branch and want to integrate feature-branch before pushing.' Ask students to write the command they should run first and a one-sentence explanation of why it matters.

Exit Ticket

During the Gallery Walk of Git Workflow Diagrams, have students list three essential Git commands and briefly describe the purpose of each, such as 'commit - captures staged changes in history' or 'push - uploads local commits to a remote repository'.

Peer Assessment

After the Collaborative Lab on Intentional Merge Conflict, pair students to swap exercises. Each student must resolve the conflict, then provide written feedback on their partner’s explanation of the steps and their resolution clarity.

Extensions & Scaffolding

  • Challenge: Ask students to create a GitHub Pages site documenting their project, including a README that explains their branching strategy and commit conventions.
  • Scaffolding: Provide a partially completed repository with sample files so students can focus on staging, committing, and branching without first writing code.
  • Deeper: Introduce rebasing as an alternative to merging, then have students compare the two strategies in a follow-up discussion.

Key Vocabulary

Repository (Repo)A storage location for all the files and version history of a project managed by Git.
CommitA snapshot of the project's files at a specific point in time, saved to the repository's history.
BranchAn independent line of development within a repository, allowing work on new features without affecting the main codebase.
MergeThe process of combining changes from one branch into another, integrating different lines of development.
Remote RepositoryA version of the project's repository hosted on a server, such as GitHub or GitLab, used for collaboration and backup.
ConflictA situation that occurs when Git cannot automatically combine changes from different branches, requiring manual resolution.

Ready to teach Version Control with Git?

Generate a full mission with everything you need

Generate a Mission