Github Pages is an intuitive, static site hosting service provided by GitHub, offering a user-friendly platform to create and maintain personal websites directly from a GitHub repository. Whether you're a hobbyist, a professional, or a business, Github Pages presents a straightforward way to establish an online presence.

In this comprehensive tutorial, we'll walk you through the process of creating and customizing your own website using Github Pages, ensuring a seamless journey from setup to deployment. Let's dive right in!

Setting Up Your Github Pages Repository
Establishing your GitHub Pages environment begins with creating a new repository with a specific naming convention. Let's explore the steps involved.

First, log in to your GitHub account and create a new repository. Name it in the format username.github.io, where "username" is your GitHub username. This naming convention is critical for Github Pages to recognize and deploy your site correctly.
Initializing Your Repository

Next, initialize your repository by creating an empty index.html file. This file will serve as the primary entry point for your website. To do this, follow these steps in your terminal:
- Navigate to your local project directory
- Initialize a new Git repository:
git init - Create an
index.htmlfile:touch index.html - Git add, commit, and push your changes:
Adding Your Custom Domain (Optional)

If you prefer to use a custom domain instead of your GitHub Pages URL, follow these steps:
- Purchase and set up your domain with your preferred Registrar.
- Navigate to your GitHub repository settings and scroll down to the "GitHub Pages" section.
- Enter your custom domain (
yourdomain.com), select the 'enforce HTTPS' option, then click 'Save'. - Configure your domain's DNS settings to point to the GitHub Nameservers.
Creating and Customizing Your Site

Now that your environment is set up, let's create and customize your website. Here, we'll focus on a basic HTML/CSS layout using a static site generator like Jekyll, a popular choice for Github Pages.
First, install Jekyll and set up a new site in your repository. Then, you can use the default layouts and templates to create your site structure. Alternatively, you can also use themes to expedite the process.




















Building a Simple Jekyll Site
To create a basic Jekyll site, follow these steps:
- Install Jekyll using Ruby:
gem install jekyll - Create a new Jekyll site using the default template:
jekyll new my-new-site - Navigate to your site directory:
cd my-new-site - Start the Jekyll server:
jekyll serve
Publishing Your Site
Once you've finalized your website, it's time to publish it. GitHub Pages will automatically build your site whenever you push changes to the main branch of your repository. Here's how to proceed:
- Commit and push your changes locally:
- Visit https://yourusername.github.io or your custom domain to see your live site.
git add .
git commit -m "Commit message"
git push origin main
Congratulations! You've successfully created and deployed your website using GitHub Pages. The online world awaits the unique content and perspectives you have to offer. Happy publishing!