Web Technologies 2026 · BiUH
Your work gets a history — and goes online.
You have done this
There is a better way.
Why bother
Git answers the first three. GitHub answers the fourth — and lets other people see your work.
Part 1 · A bit of history
With a central server, no connection meant no saving. With Git, your laptop has everything — the internet is only for sharing.
Part 1 · April 2005
Part 1 · The name
"git" is British slang for
an annoying person.
Torvalds joked that he names all his projects after himself: first Linux, now git. The README called it "the stupid content tracker".
Stupid on purpose: Git does not understand your code. It only remembers exactly what every file looked like, and when.
Part 1 · 2008 — today
It is not the only one: GitLab, Bitbucket and, in China, Gitee do the same job. The Git underneath is identical.
Linux's whole history is readable there too: github.com/torvalds/linux — more than a million commits.
Part 2
Part 2 · Git, explained with a game
"The AI rewrote my whole page" stops being a disaster. It becomes: load the last save.
Part 2 · Git, explained with photos
git diff.Part 2 · GitHub, explained
You work on your laptop with Git. Every so often, you send your new photos up to GitHub. That is a push.
Part 2 · The thing to get straight
You can use Git without GitHub. You cannot use GitHub without Git.
Part 2 · Words you will hear
| repository · repo | a folder Git is tracking, together with its whole history |
| commit | one save point: a snapshot, a message, an author, a time, an id |
stage · git add | choose what goes into the next commit |
| push | send your new commits up to GitHub |
| pull | bring down commits from GitHub that you do not have yet |
| clone | download a whole repository, history included |
| remote · origin | the copy on GitHub — origin is its usual nickname |
| main | the name of your line of history |
Part 2 · Three words do most of the work
git pull brings it back down — on another computer, or after you changed something on github.comadd and commit work without internet. Only push and pull need it.
Part 2 · What a commit looks like
e41c9a2 Add five project ideas and pick one
7b03d1f Link the machine from the nav
c2a8e55 Add the useless machine page
91f0b3c Build the four pages from the recap
This list is your 20% process grade. It grows week by week — and it cannot be written the night before.
Part 2 · Where the history lives
.git.git init. Your files stay where they are.git init inside my-site — never in your home folder or on the Desktop.Cannot see it? It is hidden. That is normal — macOS: ⌘⇧. in Finder · Windows: View → Hidden items.
Part 3 · Installing it · first, check
git --version
git version 2.47.1 — any 2.x is fine. Skip to "Tell Git who you are".
command not found or not recognized — install it, next slide.
The terminal inside VS Code is fine: Terminal → New Terminal.
Part 3 · Installing it
maingit --versiongit --version againUsing Homebrew already? brew install git does the same.
Download crawling? The same Windows installer is mirrored on npmmirror.com (search "git-for-windows").
Part 3 · Once per computer
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main
git config --list # check: your name and email should be there
A wrong email has stopped real deployments: the hosting service could not match the commit to an account, and refused to build.
Part 3 · Once · an account
github.com/your-name.
Pick one you would put on a CV.git config.GitHub slow or unreachable on your network? Gitee (gitee.com) works the same way — same Git, a different address. Tell me which one you use.
Part 3 · You do not need the terminal for everything
Ctrl+Shift+G (macOS: ⌃⇧G)The buttons run exactly the same commands. Learn both: the buttons for speed, the commands so you know what the buttons do.
Part 4 · Your first repository · in the terminal
my-site under Git — and on GitHub.# once per project
git init
git add .
git commit -m "Build the four pages from the recap"
# once: on github.com create a new, EMPTY repository called my-site, then
git remote add origin https://github.com/YOUR-NAME/my-site.git
git branch -M main
git push -u origin main
The terminal asks for a password? GitHub no longer accepts your account password here. Sign in through VS Code (next slide), and push again.
Part 4 · Your first repository · with buttons
my-siteBuild the four pages from the recapPublic, because I need to see it — and so will the hosting that puts your site online.
Part 4 · What never goes in
.gitignore..DS_Store
Thumbs.db
node_modules/
.env
.gitignore in my-site. Git pretends the files listed in it do not exist..DS_Store, Thumbs.db — junk your operating system leaves behind.env — passwords and keys. Never commit it.Pushed a password by accident? Change the password. Deleting the file is not enough — it is still in the history.
Part 4 · Every day after that
git status # what changed?
git add .
git commit -m "Say what changed"
git push
Commit before every AI prompt. If it breaks something, you are one click from where you were.
Part 4 · The commands that save you
| You want to know | Type |
|---|---|
| What have I changed since the last commit? | git status |
| Exactly which lines? | git diff |
| What did I do before? | git log --oneline |
| Throw away everything since the last commit | git restore . · VS Code: Discard All Changes |
git restore . cannot be undone — what was not committed is gone. That is the point of committing often.
Part 4 · Going back · with VS Code's own buttons
| Back to | Click | What happens |
|---|---|---|
| The last commityou have not committed since it broke | Source Control → hover a file → ↶ Discard Changes — or ↶ on Changes for all of them | The files are exactly as they were at your last commit. What you had not committed is gone. |
| Before the last commitonly if you have not pushed it | Source Control → ··· → Commit → Undo Last Commit | The commit disappears. Its changes wait in the list — fix them, or discard them as above. |
| One file, further back"the nav worked last week" | Open the file → Explorer → Timeline (at the bottom) → click a commit | Then and now, side by side. Copy back the lines you need, then commit. |
| The whole site, further backto look, not to edit | Source Control → Graph → right-click a commit → Checkout (Detached) | Your folder turns into that version — open it with Live Server. Done? Click the commit ID, bottom left → main. |
Already pushed? Do not undo it — fix it with a new commit. Once history is on GitHub, only add to it.
Part 4 · When it goes wrong · read the message
| It says | It means |
|---|---|
| fatal: not a git repository | You are in the wrong folder. Open my-site. |
| Author identity unknown | Git does not know who you are: run the two git config lines. |
| Support for password authentication was removed | GitHub wants a sign-in, not your password: sign in through VS Code. |
| src refspec main does not match any | Nothing committed yet — commit first, then push. |
| rejected … (fetch first) | GitHub has a commit you do not: git pull, then push again. |
| Failed to connect to github.com | The network. Try again, or use Gitee. |
Copy the message, read it out loud, then search it. That is not cheating — it is how everyone uses Git.
Not today
Branches, merging, pull requests —
they arrive when you need them.
Today: one line of history, and add · commit · push. That is most of what you will ever do with Git, every day.
Before you leave today
git --version answersgit config --listmy-site is a repository with a first commit