What are Git and GitHub, and why does your website need them?

No developer jargon. What Git and GitHub actually do, the six words you’ll keep hearing, and how to undo a bad change in two clicks.

Londynn Metten

· 6 min read

You’ll end up with

Your site’s code in a GitHub account you own, and the know-how to undo any change

Time
About 30 minutes
Cost
Free
Level
Beginner

The short answer

Git is a tool that saves every version of a folder, so you can see what changed, who changed it, and go back to any earlier version. GitHub is a website that keeps that folder and its whole history online. For a website owner, that means you own your site’s code outright, every change can be undone, and hosts like Cloudflare and Vercel can publish your site automatically every time something on GitHub changes. It’s free, and you never have to touch a terminal to use it.

01

What is Git, in plain words?

Git is save points for a folder. Your website is a folder of files. Every time you save a change with Git, it takes a snapshot of the whole folder and asks you for a short note about what you did.

Those snapshots never get thrown away. So a year from now you can still see that on March 3rd someone changed the phone number in the footer, read their note about why, and put the old one back if they got it wrong.

If you’ve ever used version history in Google Docs, you already get the idea. Git is that, for a whole website.

02

So what is GitHub, and how is it different from Git?

Git is the tool. GitHub is the place. GitHub is a website where your folder, with every snapshot Git ever took of it, lives online. You can browse your files there, edit them, see the history, and let other people (or an AI assistant) work on them.

You can use Git without GitHub, and there are other places like it. GitHub is the one almost every host and every AI coding tool connects to, so it’s the one we use.

03

What do the six words you keep hearing mean?

WordWhat it meansIn website terms
Repository (repo)The folder plus its whole historyYour website, all of it
CommitOne saved snapshot, with a note“Changed the opening hours”
BranchA separate copy to try things onA draft of the site nobody sees yet
MainThe branch that countsThe live site
Push / pullSend changes up to GitHub / bring them downUpload your edits / get the latest
Pull request (PR)A request to move a branch into main“Here’s my draft, can it go live?”
Live site (called “main”) Draft (called a “branch”)
  1. Launch the new site

    saved to the live sitelive

  2. Fix the footer phone number

    saved to the live sitelive

  3. Start a draft: new hours

    nobody sees it yet

  4. Change the opening hours

    saved to the draft, a preview link appears

  5. Publish the draft

    called “merge”: the draft becomes the live sitelive

How a change travels: saved to a draft, checked on a preview, then published to the live site.

That’s honestly most of it. Branch, check, merge. The rest is detail.

04

Why does a website owner need this?

  • You own it. The code sits in your account, not inside a builder or an agency’s server. You can take it to any developer or any host.
  • Nothing is ever lost. Every version of every file is kept, so any mistake is reversible.
  • It publishes your site. Connect a host once and every change to main goes live by itself. No uploads.
  • Help can’t break the live site. A developer or an AI works on a branch, you look at a preview, and only then does it go live.
  • There’s a paper trail. Who changed what, when, and why, forever.

This is the piece our client was missing when they got stuck in the builder. The code existed, but not anywhere they controlled. Part one tells that story.

05

How do you set up GitHub for your site?

  1. 01Create an account at github.com with your business email. Pick a username you’d be happy to show a client.
  2. 02Turn on two-factor sign-in under Settings, then Password and authentication. This account will hold your whole website, so treat it like your bank login.
  3. 03Get your site into a repository. If you built it in v0, use its GitHub option to create the repo in your account. If a developer built it, ask them to transfer the repository to you, or to add you as an owner.
  4. 04Keep it private. Private repositories are free, and a business site has no reason to show its code to the world.
  5. 05Invite help as a collaborator, not an owner. In the repository, go to Settings, then Collaborators, and add them by username. You can remove them any time.

The one rule: the repository lives in your account. Developers and agencies come and go. Your site shouldn’t go with them.

06

How do you read your site’s history?

Open your repository on GitHub and click the commit count near the top of the file list (it says something like “214 Commits”). That’s every change ever made, newest first, each with its note and who made it.

Click any commit to see exactly what changed: removed lines in red, added lines in green. You don’t need to understand code to spot that “Open 9 to 5” became “Open 9 to 6.”

07

How do you undo a bad change?

Two easy ways, depending on how the change got in.

  1. 01If it came in through a pull request: open the merged pull request on GitHub and click Revert. GitHub makes a new pull request that undoes it. Merge that one and the site goes back.
  2. 02If it was saved straight to main: open GitHub Desktop, go to the History tab, right-click the commit and choose “Revert changes in commit”, then click Push origin.

Version 1

“Open 9 to 5”

What the site said.

Version 2 · the mistake

“Open 9 to 6”

Published by accident.

Version 3 · the undo

“Open 9 to 5”

Back in a minute or two. GitHub calls it “revert”.

All three stay in the history

Undoing doesn’t erase the mistake. It saves a new version that puts things back.

Either way, nothing gets deleted. Git adds a new snapshot that reverses the old one, so the mistake and the fix both stay in the history. That’s a feature.

08

Do you have to use the terminal?

No. GitHub’s website handles small edits, GitHub Desktop handles everything else, and an AI assistant can do the Git part for you. But if you’re curious, these are the only commands most site owners ever need.

git clone <repo-url>      # download the site to your computer, once
git pull                  # get the latest changes
git switch -c new-hours   # start a branch called new-hours
git add .                 # stage everything you changed
git commit -m "New hours" # save a snapshot with a note
git push                  # send it up to GitHub
Everything after the # is a note to you, not part of the command.

Next, part three puts this to work: editing your own Next.js site, right on GitHub.

09

What GitHub won’t do for you

GitHub backs up your code, not everything around it. Your domain, your email, your DNS settings, and whatever your forms collected live somewhere else, and need their own logins written down somewhere safe.

It’s also not a place for big media. GitHub blocks any single file over 100 MB and gets slow well before that, so long videos belong on a video host, not in your repository.

And it isn’t an editing dashboard. If your team wants to type posts into a friendly screen and press publish, that’s a content management system on top of GitHub, not GitHub itself.

Common questions

Is GitHub free?
Yes, for this. The free plan includes unlimited private repositories and collaborators, which covers a small business website comfortably. Paid plans add team management features you won’t need yet.
Is my code public on GitHub?
Only if you choose public when you create the repository. Pick private and only the people you invite can see it. You can change it later in the repository settings.
What’s the difference between Git and GitHub?
Git is the tool that saves versions of your files. GitHub is a website that stores those files and their history online, and adds pull requests, collaborators and connections to hosts. You use them together.
My developer owns the repository. What do I do?
Ask them to transfer it to your account. It’s a setting in the repository (Settings, then Transfer) and takes a minute. The history comes with it, and they can stay on as a collaborator.
Can I break my site by using GitHub?
You can push a mistake live if you save straight to main. That’s why changes go on a branch first, and why every mistake can be reverted. Nothing you do in GitHub is permanent.

Keep going

More you can build yourself

Up next · Part 3

How to edit your own Next.js website without breaking it

15 minutes a changeBeginner

Playbook · Part 5

How to edit your website with Claude, ChatGPT or Grok, with prompts you can copy

10 minutes an editBeginner

Build it yourself

How to ship a one-page website with Claude, v0, and GitHub in 90 minutes

About 90 minutesBeginner

Playbook · Part 4

How to deploy your Next.js site from GitHub to Cloudflare or Vercel, step by step

About 45 minutesBeginner

Playbook · Part 1

How to leave WordPress for a site you actually own

1 to 3 daysBeginner

Build it yourself

How to write one prompt that gets a usable answer on the first try

About 10 minutesBeginner

Build it yourself

How to get on Google Maps, then actually get reviews

About 1 hourBeginner

Build it yourself

How to build a brand kit you can actually reuse

About 2 hoursBeginner

Build it yourself

How to run your AI assistant in the terminal, where it can see your actual files

20 minutes to set upIntermediate

Build it yourself

How to turn a workflow you keep repeating into an AI skill that fires on its own

About 1 hourIntermediate

Fix what broke

How to tell if your contact form is silently dropping leads

About 30 minutesBeginner

Fix what broke

Why scroll animations hide content from some visitors

About 15 minutesAdvanced

Fix what broke

Why Google is indexing the wrong domain for your site

About 20 minutesIntermediate

Now that the code is yours, let’s change something on it. Part three: editing your own Next.js site.

Read part 3