Software EngineeringAlliance Girls High School
TERM 3 / LESSON 07

HOLIDAY SELF-STUDY · WEEK 3

Git and GitHub

HOLIDAY SELF-STUDY · WEEK 3 · TUTORIAL

Put your project on GitHub.
Step by step.

Move your capstone from NitroIDE into VS Code, save versions with Git, and back them up on GitHub.

  • TimeAbout 2–3 hours. Stop after any step and continue later.
  • ToolsVisual Studio Code, Git and a free GitHub account.
  • GoalYour own repository with at least three clear commits.

Do each numbered step, compare with ✅ Check, then press → for the next slide. No computer install? Use slide 12. Written guide: Lesson 7.

01

STEP 1 OF 11 · GET READY

Accounts and installs.

  1. With a parent’s or guardian’s permission, create a free account at github.com/signup. Use a strong password and turn on two-factor authentication if you can.
  2. Install Visual Studio Code from code.visualstudio.com.
  3. Install Git from git-scm.com/downloads. Keep the default options.
  4. Cannot install software? Skip to slide 12 and use the browser.

✅ Check: you can sign in to GitHub and open VS Code.

02

STEP 2 OF 11 · VS CODE

Open your project in VS Code.

  1. In NitroIDE, open your capstone and click Prefs → Download ZIP.
  2. Unzip it into a new folder, for example Documents/my-capstone.
  3. In VS Code, choose File → Open Folder and pick that folder.
  4. If asked, click Yes, I trust the authors.

✅ Check: the Explorer on the left lists index.html, style.css and script.js.

03

STEP 3 OF 11 · INDEX.HTML

Fix the page head.

  1. Open index.html.
  2. Add the viewport line so phones show it properly.
  3. Change Exported Project to your project name.
  4. Check the link and script lines exist. Save with Ctrl+S.
  5. Double-click index.html in your folder to open it in a browser.

index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>CyberSmart Quest</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  …your page…
  <script src="script.js"></script>
</body>
</html>

✅ Check: your page looks and works the way it did in NitroIDE.

Images: make an images folder, put permitted images in it and use src="images/name.jpg".

04

STEP 4 OF 11 · TERMINAL · FIRST TIME ONLY

Tell Git who you are.

  1. In VS Code, choose Terminal → New Terminal.
  2. Type the first line with your first name, then press Enter.
  3. Type the second line with your GitHub email, then press Enter.

terminal

git config --global user.name "Your First Name"
git config --global user.email "you@example.com"

✅ Check: no message appears. That means it worked.

To keep your email private, use the “noreply” address from GitHub Settings → Emails.

05

STEP 5 OF 11 · TERMINAL

Make your first commit.

  1. Run each line in the terminal, one at a time.
  2. git init starts history in this folder.
  3. git add . chooses every file in the folder.
  4. git commit saves a labelled version.

terminal

git init
git add .
git commit -m "Create capstone website"
git branch -M main

✅ Check: a message like 3 files changed after the commit line.

Keep only project files in this folder. Never add passwords or private documents.

06

STEP 6 OF 11 · GITHUB.COM

Create the repository.

  1. On github.com, click + → New repository.
  2. Name it after your project, for example cybersmart-quest.
  3. Choose Public if your school allows it. Free GitHub Pages needs a public repository.
  4. Do not tick “Add a README”. Leave it empty.
  5. Click Create repository.

✅ Check: a “Quick setup” page with an address ending in .git.

07

STEP 7 OF 11 · TERMINAL

Push your code to GitHub.

  1. Copy the .git address from the Quick setup page.
  2. Run the first line with your address.
  3. Run the second line.
  4. If a sign-in window opens, choose Sign in with your browser.

terminal

git remote add origin https://github.com/YOUR-NAME/cybersmart-quest.git
git push -u origin main

✅ Check: refresh the GitHub page. Your three files are there.

Never paste a password or token that someone else gives you.

08

STEP 8 OF 11 · EVERY STUDY SESSION

Change, commit, push.

  1. Make one small improvement and save.
  2. git status shows which files changed.
  3. git diff shows the exact lines. Press q to exit.
  4. Commit with a message that says what you finished, then push.

terminal

git status
git diff
git add .
git commit -m "Add empty state to search"
git push

✅ Check: on GitHub, the number of commits goes up by one.

Good: “Add empty state to search”. Avoid: “update”, “stuff”, “final-final”. You can also use the Source Control icon in VS Code.

09

STEP 9 OF 11 · HUB + CYBERSMART ONLY

Move data into a JSON file.

  1. Make a new file: opportunities.json or questions.json.
  2. Paste your array. Put every key in double quotes.
  3. In your load function, swap const data = opportunities; for the two fetch lines.
  4. Commit: Move data into JSON file, then push.

two files

// opportunities.json
[
  { "title": "Coding club", "category": "tech" },
  { "title": "Science fair", "category": "science" }
]

// script.js – inside your load function
const response = await fetch("opportunities.json");
const data = await response.json();

✅ Check: the commit is on GitHub. Weather Dashboard: skip this step.

Opened by double-click, the page will show your error message. That is expected: fetch cannot read files from your computer. It works on GitHub Pages in Lesson 8.

10

STEP 10 OF 11 · HISTORY

Read your history.

  1. Run git log --oneline.
  2. On GitHub, click Commits above your file list.
  3. Open one commit. Green lines were added; red lines were removed.

terminal

git log --oneline

a1b2c3d Move data into JSON file
9f8e7d6 Add empty state to search
4c5b6a7 Create capstone website

✅ Check: at least three commits, each with a clear message.

11

NO INSTALL? · BROWSER PATH

Do it all in the browser.

  1. On GitHub, create a Public repository. This time, tick “Add a README”.
  2. Click Add file → Upload files, drag in your unzipped files and click Commit changes.
  3. On your repository page, press the . (full stop) key. VS Code for the Web opens.
  4. Edit a file, open Source Control, type a message and click Commit & Push.

✅ Check: your files and commits are on GitHub, the same as the terminal path.

12

STUCK? · COMMON FIXES

Read the first error line.

  • “git is not recognized”Install Git, then close and reopen VS Code.
  • “Author identity unknown”Do Step 4, then run the commit again.
  • “src refspec main does not match”You have not committed yet. Do Step 5, then push.
  • Push “rejected”Your GitHub repository is not empty. Create a new empty one (no README) and use its address.

Still stuck? Copy the exact error message into the program group and ask a facilitator.

13

STEP 11 OF 11 · JOURNAL

Save it. Explain it.

  1. Push your latest work.
  2. In your journal, explain repository, commit and history in your own words.
  3. Write where on GitHub you can see which files changed in a commit.

✅ Check: your capstone is in your own repository with at least three clear commits.

Next: Lesson 8 — publish your site →

14
01/14

← → to navigate · F fullscreen

Slide 1 of 14