Publish your project with GitHub Pages in simple steps: create a repo, clone locally, add files, commit & push changes, enable Pages, and set up a custom domain.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Step 1: Create a GitHub repository
my-project
. This will serve as the URL slug.
Step 2: Clone the repository locally
git clone https://github.com/your-username/my-project.git
cd my-project
Step 3: Add your project files
index.html
file (or a docs
folder containing index.html
). This will be the entry point of your site.index.html
in your code editor and add your HTML content. For example:<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Project</title>
</head>
<body>
<h1>Hello, GitHub Pages!</h1>
<p>This is my awesome project.</p>
</body>
</html>
Step 4: Commit and push your changes
git add .
git commit -m "Initial commit of GitHub Pages site"
git push origin main
main
with master
if your default branch is named differently.
Step 5: Enable GitHub Pages in repository settings
main
) and choose / (root) or /docs
folder if you placed files there.https://your-username.github.io/my-project/
Step 6: Verify your live site
Step 7: Update and maintain your site
git add .
git commit -m "Update content"
git push origin main
Bonus: Using a custom domain
www.example.com
).CNAME
or A
records to your DNS provider.CNAME
file to the root of your repository containing your domain name:echo "www.example.com" > CNAME
git add CNAME
git commit -m "Add custom domain"
git push origin main
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.