Free mini-course · Lesson 4 of 4
4 From code to online: publishing on GitHub Pages
Put your app on the internet for free, with a link you can send to anyone.
What you’ll do in this lesson
Put my-first-app online, for free, with a link like your-username.github.io/my-first-app that opens on any phone.
If you built the app from your spec in the last lesson, put it in my-first-app (it can replace the “Hello, world!” page). Then the link you share is your own app, not just the first test.
Three words to know
- Git keeps the version history of your project, on your computer. Each saved version is called a commit, like a snapshot of the project at that moment.
- GitHub is a website that keeps a copy of the project in the cloud.
- GitHub Pages is a free GitHub service that turns that copy into a public website.
Before you start
- Create a free account at github.com if you don’t have one.
- Check that Git is installed:
git --version
On a Mac, if it isn’t installed, the system offers to install the developer tools: accept. On Windows, install Git for Windows.
Step 1: Save a version with Git
Open Claude Code in the project folder and ask:
Initialize a Git repository in this folder and make the first commit with all the files. Explain every command you run.
Read the explanations. You don’t need to memorize the commands, but you do need to know what each one does.
Step 2: Send it to GitHub
Pick one of these two paths.
Path A: through the GitHub website
- On GitHub, click New repository.
- Name:
my-first-app. Select Public. Don’t add a README. - Click Create repository and copy the address it shows (it ends in
.git). - In Claude Code, ask:
Connect this repository to GitHub at https://github.com/YOUR-USERNAME/my-first-app.git and push the code to the main branch.
Replace YOUR-USERNAME with your GitHub username. If it asks you to log in and your password doesn’t work, that’s normal: GitHub no longer accepts passwords from the terminal. Use Path B, which takes care of logging in.
Path B: with the GitHub CLI (faster)
Install the GitHub CLI, log in once, and create the repository with a single command:
gh auth login
gh repo create my-first-app --public --source=. --push
Step 3: Turn on GitHub Pages
- In your repository on GitHub, open Settings.
- In the sidebar, click Pages.
- Under Build and deployment, choose Source: Deploy from a branch.
- Select the main branch and the / (root) folder. Click Save.
- Wait a minute or two and reload the page. Your site’s link appears at the top.
The classic first-deploy bug
You tested with a local server and everything looked great. You publish, open the link, and… the site shows up with no styling at all, just black text on a white background. The problem is on one line of this file:
The AI makes this mistake often. If it happens to you, you know what to ask for: “use relative paths for the CSS and JS files”.
Updating the site
Changed something in the project? Ask Claude:
Commit and push the changes with a message that describes what changed.
In a minute or two, the live site updates on its own.
Mark it complete to track your progress.
Congratulations, you finished the mini-course!
You picked and installed a coding agent, learned to guide the AI with a spec, and put an app online. That's already more than most people ever do. In the full course, you build a 3D game, a map app, an AI app, and your portfolio.
See the full courseWant to know when the full course opens?
One email a week with a new lesson, a project, and a tip. No spam, unsubscribe anytime.