← VCE Software Development U4O1

Sharing code with git push, pull and clone

clone copies a remote repository to your computer; push uploads your commits to the remote; pull downloads other people's new changes into your copy.

Understanding Sharing code with git push, pull and clone in VCE Software Development U4O1

What it does: git pull fetches new changes from the remote and merges them into your local branch, keeping you up to date. Cloning is the first step for a new team member, as it creates a local repository linked to the remote. You must save a snapshot with git add and git commit first. Only commits are uploaded by git push. Commits stay on your computer until you push them. git clone downloads a repository and never uploads anything.

Common mistakes: git push uploads your commits. To download teammates' new commits you need git pull origin main. There is no git copy command. To copy a remote repository to your computer, use git clone followed by the URL.

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 82–114) and word search (Modules 3–114).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which command copies a remote repository onto your computer for the first time?
git clonegit push
Matches
git push origin main (to get a teammate's new work)
↓
push uploads your commits, it does not download. To receive a teammate's work you need git pull.
Applying
Meanings
Term
git clone, git push, git pull
Meaning
clone copies a remote repository to your computer; push uploads your commits to the remote; pull downloads other people's new changes into your copy.
Practice
git clone https://github.com/team/app.git
Testing
Gaps
git https://github.com/sam/quiz.git
Check Answer
Spots
2# get teammates' new commits
3git push origin main

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

The 'Woodpecker' badge — Tap Tap Tap, 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. Which command copies a remote repository onto your computer for the first time?
A. git clone ✓
B. git push
git clone makes a full local copy of a remote repository, including its history. git push only sends commits that you already have.
2. You have made two commits on your laptop. Which command uploads them to the remote repository?
A. git pull
B. git push ✓
git push sends your local commits to the remote so teammates can get them. git pull works the other way and downloads changes.
3. A teammate pushed new code to the remote. Which command brings it into your copy?
A. git pull ✓
B. git push
git pull downloads other people's new commits and merges them into your local copy. git push would upload your own commits instead.
4. True or false: git push uploads uncommitted changes in your working folder.
A. False: git push only uploads commits ✓
B. True: git push uploads every saved file
You must save a snapshot with git add and git commit first. Only commits are uploaded by git push.
5. Which line correctly copies a project from a web address?
A. git pull https://github.com/team/app.git app
B. git clone https://github.com/team/app.git ✓
git clone takes the repository URL and creates a new local copy. You use git pull later, inside an existing local copy, to update it.

Match the Pairs

git clone https://github.com/sam/quiz.git → Copies the whole remote repository, with its history, onto your computer
git push origin main → Uploads your new commits from your computer to the main branch on the remote
Download your teammates' latest commits and add them to your local copy → git pull origin main
Make a first copy of a shared project on your own computer → git clone https://github.com/sam/quiz.git
git push origin main (to get a teammate's new work) → push uploads your commits, it does not download. To receive a teammate's work you need git pull.
git clone origin main (to copy a project) → git clone needs the URL of the remote repository, not the remote name and branch name.

Key Term

git clone, git push, git pull
clone copies a remote repository to your computer; push uploads your commits to the remote; pull downloads other people's new changes into your copy.

Fill in the Blanks

1. git clone https://github.com/sam/quiz.git
Hint: Type the git command that copies a remote repository onto your computer.
2. git push origin main
Hint: Type the git command that uploads your commits to the remote repository.
3. git pull origin main
Hint: Type the git command that downloads other people's new changes into your copy.
4. git commit -m "Fix score bug" git pull origin main git push origin main
Hint: Type the command that gets teammates' changes before you upload your own.
5. git push origin main
Hint: Type the default name Git gives to the remote repository you cloned from.

Spot the Error

Question 1
A cd app
B # get teammates' new commits
C git push origin main
Line C — git push uploads your commits. To download teammates' new commits you need git pull origin main.
Question 2
A git copy https://g.co/app.git
B cd app
C git log --oneline
Line A — There is no git copy command. To copy a remote repository to your computer, use git clone followed by the URL.
Question 3
A git commit -m "Add login"
B # upload my commit to remote
C git pull origin main
Line C — git pull downloads changes from the remote. To upload your commit to the remote, use git push origin main.
Question 4
A # share my commit with team
B git push main origin
C git log --oneline
Line B — The remote name comes before the branch name. It should be git push origin main.
Question 5
A git clone https://g.co/app.git
B cd app
C git commit -am "Fix typo"
D git psuh origin main
Line D — The command is misspelt. It should be git push origin main to upload the commit to the remote.

Student with a class code? Join your class →