Skip to main content

Push Your Code to GitHub

Your site or app works locally — now it's time to put it on the internet. The first step is making sure all your code is committed and pushed to your GitHub repository. Cloudflare Pages will pull your code directly from GitHub, so everything needs to be up there before you can deploy.

Step 1: Make sure everything is committed

Open your terminal in your project folder and run:

git status

If you see files listed under "Changes not staged for commit" or "Untracked files", you need to commit them first. You can ask Claude Code to do this:

Claude Code prompt:

Commit all current changes with a descriptive message

Or do it yourself:

git add .
git commit -m "Ready for deployment"

When git status shows nothing to commit, working tree clean, you're good.

Step 2: Push to GitHub

If you've been committing but haven't pushed yet, run:

git push origin main

This uploads all your local commits to your GitHub repository.

First time pushing?

If you get an authentication error, Git may need your GitHub credentials. GitHub no longer accepts passwords for Git operations — you'll need to set up a Personal Access Token or use HTTPS credentials. Follow GitHub's guide on authentication if you hit this.

Step 3: Verify your code is on GitHub

  1. Go to your repository on GitHub (github.com/YOUR_USERNAME/your-repo-name)
  2. You should see all your project files — src/, package.json, index.html, etc.
  3. Check that the most recent commit message matches what you just pushed

If your files are there, your code is online and ready for Cloudflare to pick up.

Going forward: push to GitHub, Cloudflare updates automatically

Once your site is deployed on Cloudflare Pages (we'll do that in the next step), you won't need to touch Cloudflare again for routine updates. Every time you push code to the main branch on GitHub, Cloudflare detects the change and automatically rebuilds and redeploys your site — usually within a minute or two.

That means your workflow for making updates is always the same:

  1. Make changes locally (or ask Claude Code to make them)
  2. Commit your changes
  3. Push to GitHub

That's it. Cloudflare handles the rest. Your live site will always reflect whatever is on main.

What's next?

Now that your code is on GitHub, we'll connect it to Cloudflare Pages to deploy your site to a real URL anyone can visit.