← Notes

Note  ·  25 March 2026

Deploying a static website on GitHub

A step-by-step record of how to push a local HTML site to GitHub and make it live. Written from experience so I don't have to figure it out again.

Step 1 — Check that Git is installed

Open PowerShell and run:

PowerShell
git --version

If it returns a version number, you're good. If not, download Git from git-scm.com.

Step 2 — Create a repository on GitHub

  1. Go to github.com and log in
  2. Click the + button → New repository
  3. Name it (e.g. mysite) and set it to Public
  4. Do not add a README, .gitignore, or license
  5. Click Create repository

Step 3 — Configure Git with your identity

Run these once — Git needs to know who you are before it can commit anything.

PowerShell
git config --global user.email "your@email.com"
git config --global user.name "Your Name"

Step 4 — Initialise Git in your project folder

Navigate to your site folder, initialise a Git repository, stage all files, and make the first commit.

PowerShell
cd C:\Users\YourName\Documents\mysite
git init
git add .
git commit -m "Initial commit"

The LF/CRLF warnings that appear are harmless — just Git noting line ending differences between Windows and Linux.

Step 5 — Connect to GitHub and push

Replace yourusername with your actual GitHub username.

PowerShell
git remote add origin https://github.com/yourusername/mysite.git
git branch -M main
git push -u origin main

GitHub may open a browser window to authenticate. If it asks for a password, you need a Personal Access Token — go to Settings → Developer settings → Personal access tokens.

Step 6 — Enable GitHub Pages

  1. Go to your repository on GitHub
  2. Click Settings → Pages (in the left sidebar)
  3. Under Branch, select main and click Save

Your site will be live at:

URL
https://yourusername.github.io/mysite

It may take a minute or two for the site to go live the first time. If you see a 404, wait and refresh.

Step 7 — Updating the site after making changes

Whenever you edit files locally and want the live site to reflect those changes, run these three commands from your project folder:

PowerShell
git add .
git commit -m "describe what you changed"
git push

What each command does: git add . stages all changed files, git commit -m "..." saves a local snapshot with a note, and git push uploads everything to GitHub and updates the live site.