Github Pages: How to Upload Your Site in 3 Simple Steps

Ann Jul 09, 2026

GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, and renders them as a website. It's a powerful tool for hosting personal websites, project portfolios, and even complex web applications. But how do you upload your content to GitHub Pages? Let's dive into a step-by-step guide to help you get started.

How to Upload A Website To GitHub (EASY Method!)
How to Upload A Website To GitHub (EASY Method!)

Before we begin, ensure you have the following: a GitHub account, a repository with your website's content, and Git installed on your local machine. If you haven't set up Git, you can follow GitHub's official guide to get started.

How to Upload Your Startup Website to GitHub Pages
How to Upload Your Startup Website to GitHub Pages

Setting Up Your Repository

First, let's ensure your repository is set up correctly for GitHub Pages.

How to upload your R code on GitHub? An example with an R script on MacOS
How to upload your R code on GitHub? An example with an R script on MacOS

1. **Create a new branch**: In your repository, create a new branch named `main` (or `master`, depending on your preference). This branch will hold your website's content.

Configuring GitHub Pages

GitHub · Change is constant. GitHub keeps you ahead. Amazing Travel Destinations, Customer Stories, Software Engineer, Cloud Based, Software Development, Travel Destinations, Software, Start Up, Coding
GitHub · Change is constant. GitHub keeps you ahead. Amazing Travel Destinations, Customer Stories, Software Engineer, Cloud Based, Software Development, Travel Destinations, Software, Start Up, Coding

Next, we'll configure GitHub Pages to use this branch.

1. **Navigate to your repository**: In your browser, go to your repository's page on GitHub.

2. **Access the settings**: Click on the 'Settings' tab at the top of the page.

Host Your Website FREE on GitHub in 60 Seconds!
Host Your Website FREE on GitHub in 60 Seconds!

Setting the Source

Now, let's tell GitHub Pages where to find your website's content.

1. **Scroll down to GitHub Pages**: In the settings page, scroll down to the 'GitHub Pages' section.

How to Upload Jekyll to Github Page
How to Upload Jekyll to Github Page

2. **Select your source**: Under 'Source', choose the `main` (or `master`) branch from the dropdown menu.

3. **Click 'Save'**: Once you've selected your source, click the 'Save' button. GitHub will now start rendering your website.

How to Host a Website for Free Using GitHub Pages
How to Host a Website for Free Using GitHub Pages
How to upload files in GitHub
How to upload files in GitHub
git push – Upload Local Commits to Remote Repository
git push – Upload Local Commits to Remote Repository
GitHub - transloadit/uppy: The next open source file uploader for web browsers
GitHub - transloadit/uppy: The next open source file uploader for web browsers
an image of the jquery file upload demo page on ubullet
an image of the jquery file upload demo page on ubullet
How to Count Total Lines of Code in a GitHub Repository
How to Count Total Lines of Code in a GitHub Repository
How to upload a project to GitHub
How to upload a project to GitHub
an image of a web page with the word journey file uploaded on it
an image of a web page with the word journey file uploaded on it
Automated Org Mode Website Publishing with GitHub or SourceHut
Automated Org Mode Website Publishing with GitHub or SourceHut
An Apple-style layout focuses on clarity, spacing, and logical hierarchy, making your content
An Apple-style layout focuses on clarity, spacing, and logical hierarchy, making your content
GitHub For Beginners: Don't Get Scared, Get Started
GitHub For Beginners: Don't Get Scared, Get Started
two screens showing different types of web pages
two screens showing different types of web pages
the github chat sheet is displayed in this screenshote screen graber
the github chat sheet is displayed in this screenshote screen graber
GitHub now lets all developers upload videos to demo bugs and options
GitHub now lets all developers upload videos to demo bugs and options
Steps to Upload your Project on Github
Steps to Upload your Project on Github
GitHub · Change is constant. GitHub keeps you ahead.
GitHub · Change is constant. GitHub keeps you ahead.
the file upload screen is shown with an arrow pointing to it's end
the file upload screen is shown with an arrow pointing to it's end
Gitflow on GitHub: How to use Git Flow workflows with GitHub Based Repos
Gitflow on GitHub: How to use Git Flow workflows with GitHub Based Repos

Uploading Your Website's Content

Now that GitHub Pages is configured, let's upload your website's content.

1. **Push your content to the `main` branch**: Use Git to push your website's content to the `main` branch of your repository. Here's a simple command to do that:

git push origin main

2. **Wait a few minutes**: It might take a few minutes for GitHub to process and render your website. Be patient!

Customizing Your Domain

If you have a custom domain, you can connect it to your GitHub Pages site for a professional look.

1. **Add a CNAME file**: In your repository, create a new file named `CNAME` (all caps) in the root directory of your website. Add your custom domain to this file (e.g., `yourdomain.com`).

2. **Update your domain's DNS settings**: Log in to your domain registrar's control panel, and update your domain's A record to point to GitHub's IP address (185.244.160.0).

3. **Wait for propagation**: It can take up to 48 hours for the changes to take effect. Once it does, your custom domain should point to your GitHub Pages site.

That's it! You've successfully uploaded your website to GitHub Pages. Now, you can share your site with the world, and GitHub will handle the hosting. Happy coding!