GitHub is not just for programmers. For a website owner it is a time machine: every change is saved as a checkpoint, so a good version of your site is never lost and a bad edit can always be undone.
Step 1: One repository per website
Create a private repository for the site's files. 'Private' means only you (and people you invite) can see it — the published website stays public, the history stays yours.
Step 2: Commit at meaningful moments
A commit is a checkpoint. Make one when something works: 'homepage updated', 'contact form fixed'. The message should tell future-you what changed. Ten small clear checkpoints beat one huge 'various changes'.
Step 3: Never commit secrets
Passwords, API keys and .env files do not belong in Git history — once committed, they are hard to truly remove. Add them to a .gitignore file from day one, and keep real keys in your hosting provider's settings instead.
Step 4: Use the history when something breaks
If an update breaks the site, the history shows exactly what changed and when. You can view any previous version, compare it with today and restore it. This is the whole point: mistakes become boring instead of scary.
Step 5: Connect it to your hosting
Services like Netlify, Vercel and Cloudflare Pages can publish automatically from your repository: you push a commit, the site updates. That means the live site always matches a known checkpoint — and rolling back is one click.
Good habits
- Commit before trying anything experimental, so you have a clean point to return to.
- Look at the list of changed files before each commit — if something unexpected is there, find out why.
- Keep the repository private unless there is a reason to share it.
Once this habit is in place, you will never again say 'it worked yesterday and I do not know what changed'. If you want help setting up GitHub for your own site, that is a perfect Digital Checkup session.