How to set up a GitHub page?

If you want to create your site on GitHub with your custom HTML code, then you can do it easily with GitHub page functionality. Let’s discuss how to set up a GitHub page.

The GitHub page will host your site with username.github.io URL. That will be super fast as it is hosted on GitHub and also comes with SSL. It will get the code directly from your repository. So you don’t need to do any further process. Just push your code on the repo and boom. Your changes will be there on the site in a few minutes.

You must have a GitHub account for that.

Create a GitHub repo

Create a public repo with the name username.github.io where the username will be your actual username on GitHub.

Create a repo for the GitHub page.

Add HTML code

Push some of your HTML code to the repo. Below is a simple example but you can add your whole code.

HTML Code.

Visit the browser with [username].github.io URL

And now you’re done. Go to your browser and hit the URL https://username.github.io

Page setup on github.io

You’ve successfully launched your GitHub Page.

This is just an example of the GitHub URL. If you see my URL is not working in the future, either we would have removed it or removed the page itself. But you can continue with your own URL.

If you still face some issues, your URL is not working or anything else. Go to that repository Settings > Pages. You will find all settings there. Try to select a branch in the Branch setting.

GitHub page setting.

You can also set up your custom domain. And your GitHub hosted site will run on that domain. Click here to read how you can configure your custom domain with GitHub Page.

Must Read:

Share this:

Related Post

Git Cheat Sheet 2024

Git Cheat Sheet 2024

Enhancing Your Readme on GitHub for Maximum Impact

Enhancing Your Readme on GitHub for Maximum Impact

A Beginner’s Guide to Understanding Github Copilot 2024

A Beginner’s Guide to Understanding Github Copilot 2024