GitHub for beginners: why your project needs versions, and how a push becomes a live website
What GitHub is, why every change to your project should be a version you can return to, what branches and pull requests are for, and how one push publishes your site on Cloudflare.
- What it is: GitHub keeps every version of your project online. Each saved step (a commit) can be compared, explained and undone.
- What it does for your project: you never lose work, you can try ideas on a side branch without breaking the live site, and an AI agent can work on your code safely.
- The magic part: connect GitHub to Cloudflare Pages once, and from then on every push to the main branch is a deploy. Your site is live a minute later.
- You do not have to type commands. GitHub Desktop or Claude Code does them; you only need the four words commit, push, branch, pull request.
Where to start (direct links): GitHub — sign up · GitHub Desktop — download · Claude (incl. Claude Code) — download · Cloudflare — sign up
- commits on main (what the world sees)
- a side branch for trying things
- pull request merged after green checks, then the live site
Think of cooking from a recipe you keep improving. One day you add more garlic, the next day less salt, and on the third day the dish is worse and you cannot remember what you changed. Git is the notebook where every change to the recipe is written down with a date and a reason. GitHub is that notebook kept safely online, where you, a colleague or an AI agent can read it, suggest changes and publish the result.
In the Flowsmith Academy every student puts their first website on GitHub in the first lessons. This article explains why, in two levels: a short version for your own project, and a longer one for people who want to understand how it fits together.
Why versions matter even for a tiny site
A version is a snapshot of all your files at one moment, with a short message saying what changed: "Add contact page", "Fix phone number on mobile". Three reasons to want them from day one:
- Undo for grown-ups. If a change breaks something, you return to the last good version in one step, even weeks later.
- A history you can read. "When did the price on the homepage change, and why?" has an answer.
- Safe hands for an AI agent. When Claude edits your site, every edit is a commit you can inspect and revert. That is what makes it reasonable to let an agent work on real files.
Versioning works best in small pieces. A commit that changes one thing ("make the header sticky") is easy to understand and easy to undo. A commit called "lots of fixes" is neither.
In depth: how we actually use GitHub
Repository, commit, push
A repository is the folder of your project plus its whole history. A commit records a set of changes locally. A push sends your new commits to GitHub. Until you push, your work exists only on your computer; after the push it is backed up online and visible to whoever works with you.
Branches: try things without breaking the live site
The main branch is what the world sees. A branch is a parallel line of work: you create one, change things there, and the main branch stays untouched. If the idea works, you bring it back; if not, you delete the branch and nothing happened. In our own repositories, AI agents are only allowed to write to their own branches, never directly to main.
Pull requests: the door back into main
A pull request asks to merge a branch into main. It shows exactly what changed, line by line, and it is where automatic checks run: tests, link checks, language checks. We merge only when every check is green. For a beginner the checks may be just "does the site still build"; that alone prevents most accidents. How AI agents fit into this road is described in letting AI agents merge their own pull requests.
Git → Cloudflare: a push is a deploy
This is the part that changes how working on a website feels. Cloudflare Pages can be connected to a GitHub repository. After that:
- You (or your agent) push a commit to main.
- Cloudflare notices it, builds the site and publishes it on your domain, typically within a minute.
- A push to any other branch gets its own preview address, so you can open the change on your phone before it goes live.
No FTP, no uploading files by hand, no "which version is on the server now?". The server always shows what is on main. If a deploy goes wrong, reverting the commit redeploys the previous version. The Cloudflare Pages manual walks through the one-time connection, and the edit and publish lesson shows the loop in practice.
What never goes into a repository
Passwords, API keys and tokens. A secret committed to git stays in its history even after you delete the file. Our rule and tooling for that are in handling secrets when AI agents do the work.
Do I need the command line?
No. GitHub Desktop gives you buttons for commit, push and branches. Claude Code can run the commands for you and explain them as it goes. The Git and GitHub manual covers both ways, and the command-line manual is there when you get curious.
The recipe, one more time
- Create a repository for your site on GitHub.
- Commit small, meaningful steps; push them.
- Try bigger ideas on a branch, open a pull request, merge when it looks right.
- Connect the repository to Cloudflare Pages once. From then on, a push to main is a published website.
Once this loop is in your hands, publishing stops being an event. It becomes the normal end of every small change, and that is when people start building far more than they planned. The Academy starts exactly here: from zero to hello world.
Frequently asked questions
What is the difference between Git and GitHub?
Git is the program that records versions of your files on your computer. GitHub is a website that keeps a copy of those versions online, lets other people and AI agents work on them, and can trigger actions such as publishing your site.
Do I need to learn the command line to use GitHub?
No. GitHub Desktop or an AI agent such as Claude Code can do the commands for you. It still helps to understand the four words: commit, push, branch and pull request.
Is GitHub free?
For a personal project, yes: private repositories and the basic features are free. Paid plans add more automation minutes and team features.
How does a push publish my website?
Cloudflare Pages watches your repository. When new commits arrive on the main branch, it builds and publishes the site, usually within a minute. Other branches get their own preview address.
Written from our own production systems by the Flowsmith editorial team, with AI assistance.
Want this running in your company?
Flowsmith designs and operates automations like this for small and mid-sized teams — with a person approving anything that leaves the building.