/github-for-non-tech

How to preview a website with GitHub Pages?

Learn to preview your website with GitHub Pages. Follow our step-by-step guide to create a repo, deploy code, and access your live URL seamlessly.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to preview a website with GitHub Pages?

 

Step 1: Create a GitHub repository

 

Start by setting up a new repository where your website files will live.

  • Open your web browser and go to https://github.com.
  • Sign in to your existing account or create a new one.
  • Click the New button (usually a green button near the top-left).
  • Enter a repository name (for example, my-website), add a description if you like, and choose Public.
  • Optionally check Add a README file to initialize your repo.
  • Click Create repository.

 

Step 2: Add your website files locally

 

Prepare or create the HTML, CSS, JavaScript, and any other assets in a local folder.

  • Open a terminal or command prompt.
  • Navigate to the folder that contains your website project.

cd path/to/your-website
  • If you didn’t initialize a Git repository yet, run:

git init
  • Stage your files and make the first commit:

git add .
git commit -m "Initial commit"
  • Link your local folder to the GitHub repo you just created (replace username and my-website):

git remote add origin https://github.com/username/my-website.git
git branch -M main
git push -u origin main

 

Step 3: Enable GitHub Pages in the repository settings

 

Now that your code is on GitHub, tell GitHub to host it.

 

Step 4: Configure the source branch and folder

 

Choose which branch and directory GitHub Pages should use.

  • Under Source, click the dropdown menu and select Main (or master if you use that).
  • If your site’s entry point is in the root, leave / (root) selected. Otherwise, pick /docs if you keep your built files there.
  • Click Save or Save and Continue.

 

Step 5: Wait for GitHub Pages to build your site

 

After saving, GitHub will start the publishing process.

  • You’ll see a banner indicating Your site is ready to be published or a build log.
  • It may take a minute or two for the first deployment.

 

Step 6: Access your live preview URL

 

Once deployment completes, GitHub Pages provides your site’s address.

  • Back in the Pages section of Settings, look for GitHub Pages and find the URL, typically:

https://username.github.io/my-website/
  • Click the link or paste it into your browser to view your website.

 

Step 7: Make updates and redeploy automatically

 

Any commits to the chosen branch will trigger a rebuild.

  • Edit your local files and save changes.
  • In your terminal run:

git add .
git commit -m "Update website content"
git push
  • GitHub Pages will pick up the changes and update the live site.

 

Step 8: Troubleshoot common issues

 

If your site doesn’t appear or shows errors, consider these checks:

  • Verify that index.html exists at the chosen root or /docs folder.
  • Ensure there are no build errors in the GitHub Pages log (shown in Settings).
  • Clear your browser cache or try in an incognito window.
  • Confirm branch name matches what you configured (main vs. master).
  • Check file paths for assets (CSS, JS, images) to ensure they’re correct relative URLs.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022