← VCE Software Development U4O2

Code repositories

A central store for a project's source code and its version history, shared by a team through commits, branches, pull requests and access settings (private or public).

Understanding Code repositories in VCE Software Development U4O2

What it does: Creating a pull request from a feature branch into main opens the changes for peer review, which supports secure code review in a shared repository. The --private setting limits access to approved team members, while a public repository can be viewed by anyone. A repository keeps the source code plus the history of every change, so the team can see who changed what and go back to earlier versions. Each commit is a snapshot in the version history. The author and message let the team trace changes. Public code can be read by anyone, including threat actors. Passwords and API keys should be kept outside source code.

Common mistakes: There is no 'adds' command. The staging command is 'git add main.py', which prepares the file for the next commit to the repository. The commit message must follow the -m flag. It should be: git commit -m "Add login form".

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 49–72) and word search (Modules 49–130).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What does a code repository store?
The project's source code and its full version historyOnly the final compiled program that users run
Matches
git commit -m "" (committing with no message, or with a vague one like "stuff")
↓
A commit without a clear message makes the repository's version history hard to read and audit. The message should describe what changed and why, e.g. "Add input validation to login form".
Applying
Meanings
Term
code repository
Meaning
A central store for a project's source code and its version history, shared by a team through commits, branches, pull requests and access settings (private or public).
Practice
gh repo create shop-app --private
Testing
Gaps
git -m "Add login form"
Check Answer
Spots
1git init
2git adds main.py

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Badger' badge — Determined Digger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What does a code repository store?
A. The project's source code and its full version history ✓
B. Only the final compiled program that users run
A repository keeps the source code plus the history of every change, so the team can see who changed what and go back to earlier versions.
2. What is a commit?
A. A saved snapshot of changes, recorded with a message and author ✓
B. A copy of the repository made private to one developer
Each commit is a snapshot in the version history. The author and message let the team trace changes.
3. Why would a developer create a branch?
A. To delete the version history and start again
B. To work on a feature or fix without changing the main code ✓
Branches isolate work in progress. The main branch stays stable until the changes are reviewed and merged.
4. What happens when a branch is merged?
A. Its changes are combined into another branch, such as main ✓
B. The branch is encrypted and locked from all developers
Merging brings the changes from one branch into another, so the finished work becomes part of the main code.
5. What is the main security benefit of a pull request?
A. Changes are merged instantly without anyone checking them
B. Teammates can review changes before they are merged ✓
A pull request asks for a review first. This supports peer code review and can catch vulnerabilities before they reach the main branch.

Match the Pairs

git commit -m "Fix login check" → Saves a snapshot of the changes into the repository's version history with a message describing what changed
git merge feature-login → Combines the changes from the feature-login branch into the branch you are currently on
A pull request lets teammates review a branch's changes before they are merged into the main branch → gh pr create --base main --head feature-login
A private repository restricts who can see and change the project's source code, which protects confidential code → gh repo create payroll-app --private
git commit -m "" (committing with no message, or with a vague one like "stuff") → A commit without a clear message makes the repository's version history hard to read and audit. The message should describe what changed and why, e.g. "Add input validation to login form".
git push origin main (pushing directly to main with no pull request or review) → Pushing straight to the main branch skips peer review, so insecure or faulty code can enter the project unchecked. Work should be done on a branch and merged through a pull request.

Key Term

code repository
A central store for a project's source code and its version history, shared by a team through commits, branches, pull requests and access settings (private or public).

Fill in the Blanks

1. git commit -m "Add login form"
Hint: Type the git subcommand that saves a snapshot of your changes into the repository's version history.
2. git branch feature-login
Hint: Type the git subcommand that creates a separate line of work so the main code stays safe.
3. git merge feature-login
Hint: Type the git subcommand that combines the changes from another branch into your current branch.
4. gh pr create --title "Add login form"
Hint: Type the short command group name for a request asking teammates to review changes before they are merged.
5. gh repo create secure-app --private
Hint: Type the visibility flag that limits repository access to people who have been invited.

Spot the Error

Question 1
A git init
B git adds main.py
C git commit -m "Add login"
Line B — There is no 'adds' command. The staging command is 'git add main.py', which prepares the file for the next commit to the repository.
Question 2
A git checkout -b feature-login
B git add login.py
C git commit "Add login form"
Line C — The commit message must follow the -m flag. It should be: git commit -m "Add login form".
Question 3
A git checkout main
B git pull
C git merge main
Line C — Merging main while on main does nothing. To bring the branch's commits in, it should be 'git merge feature-login'.
Question 4
A git clone https://git.io/app
B cd app
C git checkout fix-bug
D git push origin fix-bug
Line C — Without -b, Git tries to switch to a branch that doesn't exist yet. Creating a new branch needs 'git checkout -b fix-bug'.
Question 5
A git pull origin feature-nav
B Open a pull request on main
C Teammate reviews the changes
D Merge the pull request
Line A — A pull request needs the branch on the shared repository. You must push the branch with 'git push origin feature-nav', not pull it.

Student with a class code? Join your class →