Thursday, September 25, 2025

How to host your site using github

Yes! You can absolutely do this with GitHub. In fact, GitHub Pages is one of the easiest ways to host a simple HTML/CSS/JS project like your Random Number Picker so anyone can access it online.

Here’s how it works:


1️⃣ What You Need

  • A GitHub account (free)

  • Your project folder with index.html (and optional CSS/JS files)


2️⃣ Steps on GitHub

Step 1: Create a Repository

  1. Go to GitHub → log in.

  2. Click New Repository.

  3. Name it, e.g., random-number-picker.

  4. Make it Public → click Create repository.


Step 2: Upload Your Project Files

Option A: Direct Upload (No Git Installed)

  1. Open your repo → click Add file → Upload files

  2. Drag and drop index.html (and any CSS/JS files)

  3. Click Commit changes

Option B: Using Git Command Line (if Git installed)

git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/username/random-number-picker.git
git push -u origin main

Step 3: Enable GitHub Pages

  1. Go to Settings → Pages in your repo.

  2. Under Source, select:

    • Branch: main

    • Folder: /root

  3. Click Save.

  4. GitHub will give you a link like:

https://username.github.io/random-number-picker/

✅ Anyone can now open your Random Number Picker using that link.


3️⃣ Updating the Project

  • Make changes locally

  • Commit and push changes again

git add .
git commit -m "Update project"
git push
  • The GitHub Pages link will update automatically.


4️⃣ Summary

Step What to do
Create repo Name it and make it public
Upload files index.html and any CSS/JS
Enable GitHub Pages Settings → Pages → select main branch / root
Share link GitHub gives URL to open your app anywhere

0 comments:

Post a Comment

 

BEST COMPUTER GUIDE Written by Abigail Odenigbo, Published @ 2014 by NOBIGDEAL(Ipietoon)